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
forwardRefin order to haverefavailable in the component. Starting with React 19 you will haverefavailable by default in function components without needing to useforwardRef, so you would just use the component with its automatic access torefwithout having to useforwardRefat all.https://react.dev/blog/2024/12/05/react-19#ref-as-a-prop