We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When wrapping component in React.memo its stop to updating, when something changed. Its happens only if component being exported and wrapped in memo.
wdyr.js
import React from "react"; if (process.env.NODE_ENV === 'development') { const whyDidYouRender = require("@welldone-software/why-did-you-render"); whyDidYouRender(React, { trackAllPureComponents: true, logOnDifferentValues: true, collapseGroups: true, trackHooks: true, }); }
index.tsx
import './wdyr'; import React from 'react'; import { App } from './App'; const root = ReactDOM.createRoot(document.getElementById('app')!); root.render( <App/> );
App.tsx
export const App = memo(function App() { return( <div> some text </div> ); })
If I remove wdyr or remove React.memo or will import through React.lazy it work fine.
If change it like this it work to:
export function AppWrapper() { return( <App /> ); } const App = memo(function App() { return( <div> some text</div> ); })
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When wrapping component in React.memo its stop to updating, when something changed. Its happens only if component being exported and wrapped in memo.
wdyr.js
index.tsx
App.tsx
If I remove wdyr or remove React.memo or will import through React.lazy it work fine.
If change it like this it work to:
App.tsx
The text was updated successfully, but these errors were encountered: