-
-
Notifications
You must be signed in to change notification settings - Fork 169
When using react 19 a warning is shown about element.ref being removed #692
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
Comments
@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. |
I didn't forget about this but I have been focused more on getting v9 alpha out. Will come back to this in the next few days. |
I can be mistaken but this warning appear when you using export const Default: Story {
render: MyComponent
}
function MyComponent() {
const ref = useRef(null);
return <div ref={ref}/> // <--- ISSUE HERE
} rendering render: (props) => <MyComponent {...props}/> |
I think the issue is more that there are uses of forwardRef in the codebase that are deprecated in react 19 the difficult thing is that I can't really remove that without breaking react 18 support. are you saying that spreading the props fixes the warning for forwardRef too? |
Now that expo 53 is out this will be more of a priority though so I'm going to have to solve it soon, sorry that I wasn't able to yet |
updating the example and I didn't get this warning, at least not with the v9 beta. Is there anything I need to do to make the warning appear? |
let me know if you still see this issue because I'm not seeing it |
@MJanOthman can you confirm this is still an issue? not able to reproduce. |
@dannyhw I did not manage to update to v9 beta, I am getting this Error: |
@MJanOthman please check the migration steps
|
however even if its an issue with v8 still that would be good to know |
Yes it stilll show the issue with v8 |
@MJanOthman what exactly do I need to do to reproduce? does it just happen immediately when running the app? I didn't see this in my initial testing. |
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
We have a UI Library where we use:
When we used
react 18.3.1
it was working without any errors, but now after upgradingreact 18.3.1
toreact 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
?The text was updated successfully, but these errors were encountered: