Storybook: _processChildContext is not available in React 16+

Created on 20 Sep 2017  Â·  11Comments  Â·  Source: storybookjs/storybook

Is the release candidate version of React 16 support on v3.3.0-alpha.0? Using React 16.0.0-rc.3, I am getting this react-modal error:

_processChildContext is not available in React 16+.

This likely means you have multiple copies of React and are
attempting to nest a React 15 tree inside a React 16 tree using
unstable_renderSubtreeIntoContainer, which isn't supported.

Try to make sure you have only one copy of React
(and ideally, switch to ReactDOM.createPortal).
react bug

Most helpful comment

In my case rebuilding the lock file from scratch helped - I removed node_modules together with yarn.lock file and re-installed all of the dependencies. Maybe it helps somebody.

All 11 comments

There shouldn't be anything preventing React 16 from working. I wonder if you have 2 different versions of react installed?

I just perform a new app using the following and got the same error. I suspect is react-modal.

â–¶ create-react-app demo-app
â–¶ yarn add react@next react-dom@next
â–¶ getstorybook
â–¶ yarn run storybook

Visit the browser console give me these:

react-modal-error

@mech that's weird, I followed the reproduction instructions and I don't get those errors even after opening some modals. Can you please upload the project you get to GitHub as a repo?

You are right, I go to my 2nd laptop and try to use React 16.0.0-rc.3 with create-react-app and it worked fine. Sorry for that, I am surprised my main machine got issues.

Hmm, I'm running into this too. Not sure why yet.

Try making sure your yarn or NPM is latest version. When I upgrade my yarn from 0.x to 1.x, it works.

In my case rebuilding the lock file from scratch helped - I removed node_modules together with yarn.lock file and re-installed all of the dependencies. Maybe it helps somebody.

I have the same problem when I want to use to Modals from 'react-materialize'. And this project have all update. I really need this component. If you can help me, I will be thank

Guys I had this issue and it's gone now after I upgraded my yarn to 1.1.0

@Fowowski's fix worked for us!

I had the same issue. It was caused by react-modal ( used by storybook). React-modal installed its own old version of react. Removing node_modules direcory from react-modal package solves the problem.

Was this page helpful?
0 / 5 - 0 ratings