Is there a way to use Custom Trigger without using forwardRef, which is scheduled to be deprecated in React 19? #34615
-
https://react.fluentui.dev/?path=/docs/components-dialog--docs#custom-trigger |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
In versions of React previous to 19 you needed |
Beta Was this translation helpful? Give feedback.
In versions of React previous to 19 you needed
forwardRef
in order to haveref
available in the component. Starting with React 19 you will haveref
available by default in function components without needing to useforwardRef
, so you would just use the component with its automatic access toref
without having to useforwardRef
at all.https://react.dev/blog/2024/12/05/react-19#ref-as-a-prop