-
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
Component data being reused when it shouldn't. #143
Comments
Thanks for reporting this, the example you gave was very helpful in reproducing the issue. I've investigated this and confirmed that this is not actually caused by reusing data, the data is actually correct for the second call. This is being caused because of the way this default elementClasses prop is implemented, without incremental dom, which can lead to problems like this. I believe this is the same thing causing an issue that @eduardolundgren mentioned to me recently too. I'll make sure to fix this so that it won't conflict with incremental dom's logic anymore. |
Should we remove elementClasses? |
That's what I was thinking right now, not sure if it's very useful, though I do see people using it every now and then. Regardless, that would be a breaking change... It'd be safer to only remove it on the next version. |
We use elementClasses quite a bit. It is very useful in adding classes to the outer most component element. |
Awesome, we should keep it then, just need to make sure it works well with incremental dom (when we first added it we weren't using incremental dom yet). |
elementClasses is also a nice utility that react doesn't provide. A lot of our react components had to manually set a className prop and it was very annoying because we had to manually merge classes with it. So this was one thing I really liked about Metal when we started using it. If the naming convention needs to change, I see no issue with that though. |
Don't worry, the necessary changes are all internal, you shouldn't notice it (besides the issue being fixed, of course 😄) |
This has been fixed in version 2.2.0. |
This is similar to #123
On first render, the classes on the GrandChild element will be
GrandChild one
. Then when you click on the container, the new classes will beGrandChild one two
. I would expect the classes to just beGrandChild two
. I believe the GrandChild components data is being re-used when it shouldn't.Let me know if you need clarifying. Thanks!
The text was updated successfully, but these errors were encountered: