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
Can you provide a Next.js v12 example? #239
Labels
Comments
vzaidman
added
help wanted
Extra attention is needed
good first issue
Good for newcomers
labels
Apr 18, 2022
@dungle-scrubs Hello, i use next v12. You need the steps as follows : 1. Create a wdyr.jsimport React from 'react';
if (process.env.NODE_ENV === 'development') {
const whyDidYouRender = require('@welldone-software/why-did-you-render');
whyDidYouRender(React, {
trackAllPureComponents: true,
onlyLogs: true,
titleColor: "green",
});
} 2. Import the wdyr.js in _app.jsimport '../hooks/wdyr'; 3. Add props in the compostantconst XXX=()=>{
return <h1>xxx</h1>
}
XXX.whyDidYouRender = true;
export default XXX; |
@qfdk Thank you, that helped. |
For me it didn't worked untlll I added
to |
@apperside Thanks. Can confirm this was also the solution to allow |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've been trying to get it to work with Next.js v11 and now v12 but have never had any success. Would you mind providing an example?
Thanks
The text was updated successfully, but these errors were encountered: