Skip to content
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

Avoid unnecessary re-renders of wrapped component (HOC) #3

Open
jotaen opened this issue Feb 8, 2018 · 1 comment
Open

Avoid unnecessary re-renders of wrapped component (HOC) #3

jotaen opened this issue Feb 8, 2018 · 1 comment

Comments

@jotaen
Copy link

jotaen commented Feb 8, 2018

There is a style object that gets freshly created on the fly on every render. This makes the wrapped component also render every time again, because the object identity changes.

The solution would be to “cache” the style object in the component and only recompute it if necessary. (E.g. by means of componentWillReceiveProps or the like.)

@lucastobrazil
Copy link
Contributor

Started on this in this PR #4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants