-
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
Pure Components #125
Comments
You're right, this would be a good addition :) |
This issue was moved to #8 |
This issue was moved back. |
So after coming back to this and understanding more about As some background, React will always re-render when However, while metal components will update whenever the state changes ( TLDR: Metal is already implementing the behavior that I originally was hoping to add. The only thing to add here is to possibly extend the equality check to objects as well. The developer would still have to opt-in via some kind of @mairatma Does this sound correct? Because this would be such a fringe use case, and increased chances of bugs, I'm thinking this is something that should not be added to the core API. |
@mthadley yes, this makes total sense. It might still be useful to have something like this, so that projects using immutable data can use it, but I agree that it shouldn't be part of the core, it could be a separate utility module instead. |
I agree, so I'm going to close this issue here. Thanks! |
It seems like it would be useful to have the pure render logic in
metal-redux
available outside of that library. React had a mixin available for this, and we could create some kind of similar module that developers can use, but I also wonder if it is something that would be good to have at the framework level?It could still be something that is disabled by default, since the component developer needs to be aware of any mutations they might be performing on component configs attributes. However, it would be very convenient to just write something like this:
We could also go further and make function components have this behavior enabled by default. I believe I read something somewhere that the React developers were thinking about doing this for their functional components as well.
The text was updated successfully, but these errors were encountered: