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
I wanna access ref of Transition Component but I get a warning that I have to use forwardRef with Transition Component. How can I solve that?
Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?
const myRef = useRef(null);
<Transition
ref={myRef}
appear={true}
show={true}
enter='ease-out translate-x-20'
enterFrom='translate-x-20 opacity-0'
enterTo='translate-x-0 opacity-100'
leave='ease-out'
leaveFrom='translate-x-0 opacity-100'
leaveTo='translate-x-10 opacity-0'>
my text here....
</Transition>
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I wanna access ref of Transition Component but I get a warning that I have to use forwardRef with Transition Component. How can I solve that?
Beta Was this translation helpful? Give feedback.
All reactions