-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
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
Add support for React 18 #17831
Comments
This pr might be related. It doesn't look like it's as simple as bumping the peerDependencies. 🤔 |
It would be great to get some indication from the storybook team about when storybook will support React 18. Many projects will be unable to upgrade until storybook has support. |
It should be as simple as bumping the peerDependencies if you don't want storybook to use the new |
I'm hoping to get #17215 merged and released early next week. If that doesn't happen for some reason, I'll look into a simpler PR to start to bump the peer dependencies. |
Olé!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.5.0-alpha.54 containing PR #17853 that references this issue. Upgrade today to the
This is a temporary fix. Full fix still coming in #17215 |
@shilman I couldn't verify if this fixes the issue I still got but it may be needed to do the same for react-test-renderer dep. |
Ermahgerd!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.5.0-alpha.58 containing PR #17215 that references this issue. Upgrade today to the
Closing this issue. Please re-open if you think there's still more to do. |
Getting these warnings after upgrade @shilman
|
Thanks @brendonco -- safe to ignore and I'll fix in the next release |
I'm getting this after upgrading to 6.5.0-alpha.59: The pseudo class ":first-child" is potentially unsafe when doing server-side rendering. Try changing it to ":first-of-type". Logs attached: |
@valentinpalkovic any ideas? ☝️ |
@JohnCido Which version have you used before? And can you tell me, which addons are in use? @shilman I assume this warning is thrown by emotion und should be unrelated of the react 18 support. I rather think, that in the meantime emotion was potentially updated, too. Related issues: Worth to mention: The message gets already ignored in jest tests storybook/scripts/jest.init.js Line 36 in 3f3e650
We could add the required
Indeed, an adjustment would only be necessary in I will open a PR |
@valentinpalkovic "@storybook/addon-actions": "^6.5.0-alpha.59",
"@storybook/addon-essentials": "^6.5.0-alpha.59",
"@storybook/addon-interactions": "^6.5.0-alpha.59",
"@storybook/addon-links": "^6.5.0-alpha.59",
"@storybook/api": "^6.5.0-alpha.59",
"@storybook/builder-webpack5": "^6.5.0-alpha.59",
"@storybook/manager-webpack5": "^6.5.0-alpha.59",
"@storybook/react": "^6.5.0-alpha.59", |
There's still a "Warning: ReactDOM.render is no longer supported in React 18" warning in |
@Hypnosphi Thank you for the hint. This issue is already known (discussed with @shilman) and we decided to take care of the new Root API for the Storybook UI in an upcoming iteration. |
link: #17831 (comment) Would it be possible to get some more information about the sentence Is there any ticket to get information about when storybook will fully support react v18 as this one has been closed ? This thread provides hacks to move forward and use react 18 but it is soooo lengthy that it is difficult to follow. If storybook does not support yet react v18, guys, people, IT IS ALL GOOD. You guys are doing an amazing job and the fact that many people are asking in this thread is because we love storybook and want to keep it in our projects. But a more official answer would help so that everyone does not need to read this thread and still be unsure if storybook does support it without warnings or hacks such as using overrides in package.json or by using --legacy-peer-deps (based on this one https://stackoverflow.com/a/66620869/1578841 it does not seem to me really recommended to follow as it mutes valid checks and warnings) |
@alberto-f Thank you for your concerns. I try to do my best to summarize everything important to the React 18 support.
Next steps As discussed with the maintainers, we didn't want to use the new Root API to mount Storybook to the DOM because this would require profound testing of Storybook and all of its plugins. I am sure this will be done in one of the next iterations. Maybe @shilman could give some feedback in this regard. Questions
Which React version your components use relies on your installed React version. If you are installing React in version 18, then version 18 is used. The difference is only whether the concurrent features are activated. And this depends of whether the components are mounted with the new Root API or the legacy one. As already mentioned, if React 18 is in use and you haven't opt-out from the new Root API, the Root API is used, and all concurrent features are "activated".
Storybook supports mounting your components in React 18 with the new Root API. If still, some errors occur, please open a new ticket with a reproducible example. Often, the issue was related to an existing yarn.lock file, which didn't allow to resolve dependencies correctly. In some other cases, some transitive dependencies were not ready for React 18. Ideally, the support should be fine (except for the console error message from React, which tells you, that the Storybook Manager still uses the old API)
Hacks shouldn't be needed at all. I know that npm users might have the |
@valentinpalkovic Thank you so much for taking the time to clarify all the questions. It is really clear the status of storybook supporting React v18 and how to proceed if something is not working as expected. |
Take your time. Only thing that is the issue is this little warning message. When we find a solid way to get rid of that message (aka upgrade something). I think its better to wait until that fix arrives. :) |
Thank you for this precision, it prevented us to waste time in trying to find a solution to this error message. The main point to keep in mind for us is that Storybook renders of components with React 18 ( if installed ), so when we interact with them we are "really" testing them with React 18 and its concurrent features. Thank you for your amazing work :) |
@atomless Yo! DId you solve your problem with "ui with a spinner, no stories ever render"? I have the same problem too( |
This worked for me:
|
This changeset adds the initial configuration needed to spin up Storybook locally. It's incredibly simple right now, but it should include most addons that we need. Also included is a very simple CSF example for the StaticAlert component as a proof-of-concept. There's a known error with React 18 [here](storybookjs/storybook#17831 (comment)), but it shouldn't affect us for the time being. We could also install the bleeding-edge version of Storybook, but it looks like there are other issues with that as well -- so I recommend just sticking with the latest stable version until the next version is officially out.
This changeset adds the initial configuration needed to spin up Storybook locally. It's incredibly simple right now, but it should include most addons that we need. Also included are very simple CSF examples for the StaticAlert and USLink components as a proof-of-concept. There's a known error with React 18 [here](storybookjs/storybook#17831 (comment)), but it shouldn't affect us for the time being. We could also install the bleeding-edge version of Storybook, but it looks like there are other issues with that as well -- so I recommend just sticking with the latest stable version until the next version is officially out.
This changeset adds the initial configuration needed to spin up Storybook locally. It's incredibly simple right now, but it should include most addons that we need. Also included are very simple CSF examples for the StaticAlert and USLink components as a proof-of-concept. There's a known error with React 18 [here](storybookjs/storybook#17831 (comment)), but it shouldn't affect us for the time being. We could also install the bleeding-edge version of Storybook, but it looks like there are other issues with that as well -- so I recommend just sticking with the latest stable version until the next version is officially out.
This changeset adds the initial configuration needed to spin up Storybook locally. It's incredibly simple right now, but it should include most addons that we need. Also included are very simple CSF examples for the StaticAlert and USLink components as a proof-of-concept. There's a known error with React 18 [here](storybookjs/storybook#17831 (comment)), but it shouldn't affect us for the time being. We could also install the bleeding-edge version of Storybook, but it looks like there are other issues with that as well -- so I recommend just sticking with the latest stable version until the next version is officially out.
This changeset adds the initial configuration needed to spin up Storybook locally. It's incredibly simple right now, but it should include most addons that we need. Also included are very simple CSF examples for the StaticAlert and USLink components as a proof-of-concept. There's a known error with React 18 [here](storybookjs/storybook#17831 (comment)), but it shouldn't affect us for the time being. We could also install the bleeding-edge version of Storybook, but it looks like there are other issues with that as well -- so I recommend just sticking with the latest stable version until the next version is officially out.
This changeset adds the initial configuration needed to spin up Storybook locally. It's incredibly simple right now, but it should include most addons that we need. Also included are very simple CSF examples for the StaticAlert and USLink components as a proof-of-concept. There's a known error with React 18 [here](storybookjs/storybook#17831 (comment)), but it shouldn't affect us for the time being. We could also install the bleeding-edge version of Storybook, but it looks like there are other issues with that as well -- so I recommend just sticking with the latest stable version until the next version is officially out.
This changeset adds the initial configuration needed to spin up Storybook locally. It's incredibly simple right now, but it should include most addons that we need. Also included are very simple CSF examples for the StaticAlert and USLink components as a proof-of-concept. There's a known error with React 18 [here](storybookjs/storybook#17831 (comment)), but it shouldn't affect us for the time being. We could also install the bleeding-edge version of Storybook, but it looks like there are other issues with that as well -- so I recommend just sticking with the latest stable version until the next version is officially out.
This changeset adds the initial configuration needed to spin up Storybook locally. It's incredibly simple right now, but it should include most addons that we need. Also included are very simple CSF examples for the StaticAlert and USLink components as a proof-of-concept. There's a known error with React 18 [here](storybookjs/storybook#17831 (comment)), but it shouldn't affect us for the time being. We could also install the bleeding-edge version of Storybook, but it looks like there are other issues with that as well -- so I recommend just sticking with the latest stable version until the next version is officially out.
This changeset adds the initial configuration needed to spin up Storybook locally. It's incredibly simple right now, but it should include most addons that we need. Also included are very simple CSF examples for the StaticAlert and USLink components as a proof-of-concept. There's a known error with React 18 [here](storybookjs/storybook#17831 (comment)), but it shouldn't affect us for the time being. We could also install the bleeding-edge version of Storybook, but it looks like there are other issues with that as well -- so I recommend just sticking with the latest stable version until the next version is officially out.
…8803) This changeset adds the initial configuration needed to spin up Storybook locally. It's incredibly simple right now, but it should include most addons that we need. Also included are very simple CSF examples for the StaticAlert and USLink components as a proof-of-concept. There's a known error with React 18 [here](storybookjs/storybook#17831 (comment)), but it shouldn't affect us for the time being. We could also install the bleeding-edge version of Storybook, but it looks like there are other issues with that as well -- so I recommend just sticking with the latest stable version until the next version is officially out.
Is your feature request related to a problem? Please describe
Only so far as upgrading to React 18 is concerned :)
Specifically, when I try to update my
devDependencies
,@storybook/addon-controls
throws an error, because it'speerDependencies
is set to only React 16 and 17.Doublechecked in the package.json
https://github.com/storybookjs/storybook/blob/next/addons/controls/package.json#L61-L64
There's probably already some awareness of this and/or a fix in flight, but just in case I thought I'd mention it.
Describe the solution you'd like
Ideally I think it's as simple as updating the
peerDependencies
throughout Storybook's packages, but I'm sure there's some additional work in the ReactDOM.render > ReactDOM.createRoot transition that would affect Storybook's rendering cycle.Describe alternatives you've considered
None as yet
Are you able to assist to bring the feature to reality?
I'm happy to make a PR to update the peerDeps, if it was deeper than that I'd be lost :)
The text was updated successfully, but these errors were encountered: