-
Notifications
You must be signed in to change notification settings - Fork 59
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
[JSX] Unconfigured props will not be overwritten if a new undefined value is not passed in #374
Comments
I think conceptually, this is also a bug, because a JSX component's |
👎 Rob |
cc @jbalsas |
Hey guys, I'll take a look at this first thing next week! This would be a breaking change... probably no-one is relying on this specific behaviour as it is, but I'll double check existing usages out there. I agree with the expected outcome. |
I think this would be a breaking change.
Let me know if I'm wrong. I'll search some use cases using React's definition of props, that we have inspired to build metal props idea. |
There is an issue, React's props have the same behavior as @bryceosterhaus explained. |
I'm taking this issue right now |
It’s Historically Accurate Note Time™!
Actually the |
…ster on github | Fixes metal#374
…ster on github | Fixes metal#374
In the example below, the
GrandChild
component will not render its default prop of'Default Two
after clicking the button. I believe this happens because metal.js calls addUnconfiguredProps but when that prop is not passed in anymore, it re-uses the old value because the prop is not explicitly passed in by its key anymore.For example, if both
foo
andbar
are unconfigured props and we pass{foo: 1, bar: 2}
followed by passing in{foo: 2}
. The component will continue to usebar: 2
because it doesn't know to remove that prop.Check out this for a working example
cc @mthadley
The text was updated successfully, but these errors were encountered: