-
Notifications
You must be signed in to change notification settings - Fork 49.2k
Remove event namespace check from ReactPartialRenderer #10344
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
Conversation
445f56a
to
bd2624a
Compare
propValue = createMarkupForStyles(propValue, instForDebug); | ||
} | ||
var markup = null; | ||
if (isCustomComponent(tagLowercase, props)) { |
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.
I wonder what happens if you pass onChange
to a web component. Hmmm. I'll investigate.
Related to #10272. |
Does this fix the issue? Or would this PR only work if we passed attributes through or something like this? Can you explain more about what this PR does to address this? |
My original description wasn't clear. I apologize for that.
This doesn't happen because no property info exists for event handlers, so the attribute whitelist check in I am curious what would happen if you wrote an event listener on a custom attribute when server rendering. Like I am happy to convert this into an issue and close out this PR if someone else would like to tackle this. |
In any case, it sounds like this is definitely not desired behavior. This PR was intended to remove, what I thought, was an unnecessary check and only later did realize that this might be an actual issue. What if the top level event types list was built in a more general purpose config instead of in SimpleEventPlugin and co? |
I think I get it now. This doesn’t expose a bug now but if we stripped the whitelist, we’d have to tackle this problem. I’ll get this in because it simplifies the current behavior. We just have to be mindful of how we want to proceed in the future. I’m open to suggestions. |
Working through #10229, I noticed that
onchange
was coming through as markup in the server-side rendering tests. This is becauseReactPartialRenderer
uses aregistrationNameModules
check to see if a prop is an event name.I believe
registrationNameModules
is populated by event plugins, which were removed in #10173. So this condition always resolves to true. I've confirmed by running test coverage:If we remove the attribute whitelist, we need an answer here for event names on server-side rendering. I've added that to my list in #10229