-
Notifications
You must be signed in to change notification settings - Fork 201
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
Library doesn't seem to work with NextJS. #172
Comments
move
to i think it should work |
I also improved the example on next.js: |
you are free to re-open this if you'll need more help! |
@vzaidman Thanks for the help but it still doesn't work (I created a scripts folder, sibling of src and pages ones). Perhaps I shouldn't have used the Actually I don't see |
it doesn't really matter if it's in dev dependencies or in the regular ones. i think it's probably working. it's just that there's no problem with the component you linked. you wouldn't want the library to log on all the renders. the library logs on renders that could have been avoided. just to test it, try to change the component to:
|
I assume that you wrote Also, I don't understand the logic. When the counter (in my example) changes, doesn't a full rerender happen? |
Yes, but it's not a redundant one. There's no reason to track re-renders if the props change. |
You have a point. Thank you for your help man, wish more creators/maintainers were like you! |
For the record, I've got it working with Next.js for quite a while, see: But I might move it to another file indeed, would be cleaner. |
I suggest moving it to another file. It might work now, but it doesn't cover some cases which might break it. |
What I did:
npm install @welldone-software/why-did-you-render --save --dev
Added the following to
_app.js
:My component:
Clicking updates the
counter
, however the library doesn't log anything.I do see a few logs for another component though (slider from
react-slick
)The text was updated successfully, but these errors were encountered: