Enzyme + Context API = Warning: Detected multiple renderers concurrently rendering the same context provider
See original GitHub issueDo you want to request a feature or report a bug? Bug, I guess
What is the current behavior?
console.error node_modules/fbjs/lib/warning.js:33
Warning: Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported.
Steps to reproduce the behavior:
git clone https://github.com/stereobooster/react-context-issuecd react-context-issueyarnyarn test
What is the expected behavior? no warning
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React? React 16.4. Browser not affected, because error is in node.js
Open this because of https://github.com/facebook/react/pull/13127#issuecomment-402527012
Issue happens because of Enzyme (https://github.com/airbnb/enzyme/issues/1693), code is unreleased, so I copy-pasted it from master.
I’m looking for advice or some clue on how to fix this, so I would be able to create PR in Enzyme repo (or in React repo if this is the case). Thank you.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:21 (12 by maintainers)
Top Results From Across the Web
Richard Lindsey on Twitter: "@dan_abramov -- "Detected ...
-- "Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported." Is this a side-effect of having nested ...
Read more >ReactDOM.render is no longer supported in React 18 - Stack ...
ReactDOM.render has been deprecated in React 18 and currently issues a warning and ... Using it will warn and run your app in...
Read more >React Components rendered twice — any way to fix this?
Detecting legacy context API. In most cases it will throw an error message into the browser console log. It fails to automatically detect...
Read more >Legacy Context - React
This section documents a legacy API. See the new API. Suppose you have a structure like: class Button extends React.Component { render() {...
Read more >react-test-renderer | Yarn - Package Manager
The deferred render is interruptible and doesn't block user input. useSyncExternalStore is a new hook that allows external stores to support concurrent reads...
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 Free
Top 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
I wouldn’t call this a “solution”, this is just ignoring the problem (and working around it). Maybe you don’t need it fixed, but somebody else will. 😃
It’s fine if you don’t want to keep looking into this, but it does sound like a bug to me. And we should fix it.
We are at React16.5.2, but we still see this error when putting the tests using
mountandenzyme-to-jsonin one test file. Error is gone when tests are separated into two files.