Wrapping Redux connect() with withRouter() confuses WDYR
See original GitHub issueAs per title, not really sure what else I can add!
export default withRouter(connect(mapStateToProps)(_NotificationBar));
whyDidYouRender error. Please file a bug at https://github.com/welldone-software/why-did-you-render/issues.
{errorInfo: {…}}
errorInfo:
WDYRPatchedComponent: null
componentNameOrComponent: ƒ C(props)
displayName: "withRouter(Connect(_NotificationBar))"
error: TypeError: Cannot read property 'prototype' of undefined at mn
(http://localhost:7979/business.f5e0eaa5.js:45079:27658) at e
(http://localhost:7979/business.f5e0eaa5.js:45079:32377) at Un
(http://localhost:7979/business.f5e0eaa5.js:45079:32627) at $n
(http://localhost:7979/business.f5e0eaa5.js:45079:32976) at Object.Vn.e.createElement
(http://localhost:7979/business.f5e0eaa5.js:45079:34253) at AuthedLayout
(http://localhost:7979/AuthedLayout.dd37237b.js:2517:85) at renderWithHooks
(http://localhost:7979/business.f5e0eaa5.js:29330:22) at updateFunctionComponent
(http://localhost:7979/business.f5e0eaa5.js:31509:24) at mountLazyComponent
(http://localhost:7979/business.f5e0eaa5.js:31817:21) at beginWork
(http://localhost:7979/business.f5e0eaa5.js:33026:20)
isShouldTrack: true
options: {include: null, exclude: null, onlyLogs: false, notifier: ƒ, consoleLog: ƒ, …}
rest: [null]
__proto__: Object
__proto__: Object
/* eslint-disable global-require */
import React from 'react';
export default () => {
if (process.env.NODE_ENV === 'development') {
const whyDidYouRender = require('@welldone-software/why-did-you-render');
whyDidYouRender(React, {
trackAllPureComponents: true,
logOwnerReasons: true,
});
}
};
Issue Analytics
- State:
- Created 3 years ago
- Comments:26
Top Results From Across the Web
connect and withRouter issue - Stack Overflow
It already receives location and history props. I am figuring out the theory behind why the order does matter ? javascript · reactjs...
Read more >React Redux
The connect() function takes two primary arguments, both optional. The first, mapStateToProps , is a function you provide to pull data from ...
Read more >Using withRouter() to Inject the Params into Connected ...
We will learn how to use withRouter() to inject params provided by React Router into connected ... Redux: Wrapping dispatch() to Recognize Promises....
Read more >React Router with Redux: Understanding navigation state
Use React Router to declaratively navigate within your React and Redux applications and maintain state across your app's navigation ...
Read more >Higher-Order Components - React
HOCs are common in third-party React libraries, such as Redux's connect and Relay's ... Rather, a HOC composes the original component by wrapping...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
try
4.2.5
please! i had an ideaNo problem, glad to help 🙂