You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If defining a StoryFn with @storybook/react-vite, it's possible to get the following console warning:
preview.tsx:12 Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.
After debugging, I found that [email protected] is the source of the console error, on this line. It was hard to find out that storybook was responsible, as react-element-to-jsx-string is a devDependency of @storybook/react, not a runtime dependency. Clearly it's getting bundled as a part of storybook's build process, because the javascript in the stack trace matched the original source. The latest version of react-element-to-jsx-string does not have this problematic line of code, but not even [email protected] has updated this devDependency.
I've included a stackblitz repo, but a minimalistic story to reproduce is:
** Disclaimer** This information might be inaccurate, due to it being generated automatically
This can be fixed by updating the react-element-to-jsx-string dependency in @storybook/react to version 15.0.1 or later. The dependency is defined in code/lib/core-server/package.json. Update the dependency version and run yarn install to resolve the warning.
About Greptile
This response provides a starting point for your research, not a precise solution.
Help us improve! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
If defining a StoryFn with @storybook/react-vite, it's possible to get the following console warning:
After debugging, I found that [email protected] is the source of the console error, on this line. It was hard to find out that storybook was responsible, as react-element-to-jsx-string is a devDependency of @storybook/react, not a runtime dependency. Clearly it's getting bundled as a part of storybook's build process, because the javascript in the stack trace matched the original source. The latest version of react-element-to-jsx-string does not have this problematic line of code, but not even [email protected] has updated this devDependency.
I've included a stackblitz repo, but a minimalistic story to reproduce is:
Reproduction link
https://stackblitz.com/edit/github-h9ntpeay?file=src%2Fstories%2FRefTest.stories.tsx
Reproduction steps
System
Additional context
No response
The text was updated successfully, but these errors were encountered: