Skip to content
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

When using react 19 a warning is shown about element.ref being removed #692

Open
MJanOthman opened this issue Feb 24, 2025 · 1 comment
Open

Comments

@MJanOthman
Copy link

MJanOthman commented Feb 24, 2025

Describe the bug
We have a UI Library where we use:

"@storybook/addon-ondevice-actions": "^8.5.2",
"@storybook/addon-ondevice-backgrounds": "^8.5.2",
"@storybook/addon-ondevice-controls": "^8.5.2",
"@storybook/addon-ondevice-notes": "^8.5.2",
"@storybook/addon-react-native-server": "0.0.6",
"@storybook/addon-react-native-web": "^0.0.26",
"@storybook/addon-webpack5-compiler-babel": "^3.0.3",
"@storybook/blocks": "^8.5.1",
"@storybook/builder-webpack5": "^8.5.1",
"@storybook/global": "^5.0.0",
"@storybook/react": "^8.5.1",
"@storybook/react-native": "^8.5.2",
"@storybook/react-native-theming": "^8.5.2",
"@storybook/react-webpack5": "^8.5.1",
"@storybook/test": "^8.5.1",
"expo": "52.0.25",
"react": "19.0.0",
"react-dom": "19.0.0",
"react-native": "0.76.6"

When we used react 18.3.1 it was working without any errors, but now after upgrading react 18.3.1 to react 19.0.0, we are getting this error:
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..
When I run the App without storybook, it works without showing that error, so I am 100% sure it is coming form one of the storybook libraries.
Any Idea how can this be fixed now?
if there is no temporary solution, when will storybook react native support react 19?

@dannyhw
Copy link
Member

dannyhw commented Feb 24, 2025

@MJanOthman this seems like a warning not an error, it should be ignorable as a workaround for now.

I'm not sure how we would resolve this and have things still work for react 18 so I need to think about this a bit.

I will setup an example to debug this, I will need some time to investigate further.

@dannyhw dannyhw changed the title Storybook React native with react 19 throw an error Storybook React native with react 19 show a warning about refs Feb 24, 2025
@dannyhw dannyhw changed the title Storybook React native with react 19 show a warning about refs When using react 19 a warning is shown about element.ref being removed Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants