Comments (5)
It throws following exception:
TypeError: Cannot set property 'props' of undefined
at Component (http://localhost:6006/vendors~main.317c2c034316233265a1.bundle.js:267013:14)
at WithState (http://localhost:6006/vendors~main.317c2c034316233265a1.bundle.js:269148:33)
at WDYRWrappedByMemoFunctionalComponent (http://localhost:6006/vendors~main.317c2c034316233265a1.bundle.js:83010:12)
at renderWithHooks (http://localhost:6006/vendors~main.317c2c034316233265a1.bundle.js:233595:18)
at updateFunctionComponent (http://localhost:6006/vendors~main.317c2c034316233265a1.bundle.js:235284:20)
at updateSimpleMemoComponent (http://localhost:6006/vendors~main.317c2c034316233265a1.bundle.js:235230:10)
at updateMemoComponent (http://localhost:6006/vendors~main.317c2c034316233265a1.bundle.js:235149:14)
at beginWork (http://localhost:6006/vendors~main.317c2c034316233265a1.bundle.js:236346:16)
at performUnitOfWork (http://localhost:6006/vendors~main.317c2c034316233265a1.bundle.js:239969:12)
at workLoop (http://localhost:6006/vendors~main.317c2c034316233265a1.bundle.js:240009:24)
The reason is that WDYRWrappedByMemoFunctionalComponent
calls the component as a function while in fact it is a class
from why-did-you-render.
ok i might indeed fix it. and maybe even soon but React.memo is made for functional components:
https://reactjs.org/docs/react-api.html#reactmemo
are you sure it even makes your class component pure?
from why-did-you-render.
Yeah I'm pretty sure: https://github.com/facebook/react/blob/master/packages/react-reconciler/src/__tests__/ReactMemo-test.internal.js#L222
from why-did-you-render.
added a prove that this happens (a test that fails) to the following branch:
https://github.com/welldone-software/why-did-you-render/tree/%2350-memo-a-class-component
Looks like a not too hard thing to fix, if anybody wants to try to do it.
from why-did-you-render.
fixed in https://github.com/welldone-software/why-did-you-render/tree/v3.3.4
from why-did-you-render.
Related Issues (20)
- Issues with Parcel? HOT 3
- use React.lazy warp function, wdyr not work.
- Is it possible to print testID along side Component name on wdyr logs? HOT 1
- use jotai always diff
- dom npm
- wdyr not work in next13 (repo provided) HOT 2
- wdyr not work in next13 (repo provided)
- WDYR includes full lodash library with window._ override HOT 6
- Cannot get WDYR output from nextjs dynamically loaded component (e.g. for no-ssr use case) HOT 2
- Project still being actively maintained? HOT 2
- Multiple React roots
- why-did-you-render + React Query
- No logs or anything about WDYR HOT 9
- Missing `ownerDataMap` in `notifier`
- Partially Working with React 18 + NextJS 13
- "Support for defaultProps will be removed" error after setting include: [/./] option HOT 2
- Tracking custom hooks issue HOT 2
- WhyDidYouRender is not working in Storybook.js
- Property 'React' doesn't exist HOT 1
- react-refresh-webpack-plugin not updating component when wrapped with React.memo.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from why-did-you-render.