-
Notifications
You must be signed in to change notification settings - Fork 49.8k
Fix false "unknown property" warnings for events in SSR #10272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,6 +67,11 @@ if (__DEV__) { | |
| if (EventPluginRegistry.registrationNameModules.hasOwnProperty(name)) { | ||
| return true; | ||
| } | ||
| if (EventPluginRegistry.plugins.length === 0 && name.indexOf('on') === 0) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it would be nice to do lgtm otherwise, thanks! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oops, thanks for pointing it out! I totally did not think about the onions. 😛 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FWIW I considered this but thought it wasn't worth the tradeoff- (regex is much slower)- given that the DOM render would warn about onions when the client took over. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, it's probably not enough of a difference to actually matter. And it's dev-only anyway I guess. |
||
| // If no event plugins have been injected, we might be in a server environment. | ||
| // Don't check events in this case. | ||
| return true; | ||
| } | ||
| warnedProperties[name] = true; | ||
| var lowerCasedName = name.toLowerCase(); | ||
|
|
||
|
|
||

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(y)