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

react-redux 7 uses useMemo, all Connected components complaining #18

Closed
joelstransky opened this issue Apr 10, 2019 · 5 comments
Closed
Labels
blocked by an issue in another library Waiting for an issue in another library to be solved workaround available A workaround is available in the issue's comments

Comments

@joelstransky
Copy link

Great job on the new release!
I just updated react-redux to 7.0.1 and WDYR is complaining about every single one. How should we handle this?

Connect(Header)
whyDidYouRender.min.js:8 {Connect(Header): ƒ} "Re-rendered because of hook changes:"
whyDidYouRender.min.js:8 hook useMemo 
whyDidYouRender.min.js:8 different React elements with the same displayName. (more info at http://bit.ly/wdyr3)
whyDidYouRender.min.js:8 {"prev ": {…}} "!==" {"next ": {…}}
@vzaidman
Copy link
Collaborator

I'll update my projects to react-redux very soon as well so i'll fix this one shortly

@joelstransky
Copy link
Author

For now I'm just filtering it out.

if (__DEV__) {
  const whyDidYouRender = require('@welldone-software/why-did-you-render')
  whyDidYouRender(React, { include: [/^.*$/], exclude: [/^Switch/, /^Router/, /^Route/, /^Connect/] })
}

@vzaidman
Copy link
Collaborator

I believe we discovered a small performance issue with react-redux :)
I fixed it there.

@vzaidman vzaidman added blocked by an issue in another library Waiting for an issue in another library to be solved workaround available A workaround is available in the issue's comments labels Apr 12, 2019
vzaidman added a commit that referenced this issue Apr 13, 2019
notify about a re-rendered element in props and ignore if it's props are different,
improve memoized tracking performance,
fix hooks notifications of memoized components were tracked as of inner WDYR component,
fix memoized components notifications
vzaidman added a commit that referenced this issue Apr 13, 2019
notify about a re-rendered element in props and ignore if it's props are different,
improve memoized tracking performance,
fix hooks notifications of memoized components were tracked as of inner WDYR component,
fix memoized components notifications
@vzaidman
Copy link
Collaborator

vzaidman commented Apr 13, 2019

solved in [email protected] (by me :P)

@vzaidman
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked by an issue in another library Waiting for an issue in another library to be solved workaround available A workaround is available in the issue's comments
Projects
None yet
Development

No branches or pull requests

2 participants