Description
I'm struggling to add the type annotation of a useRef
attached on this player component: react-player to get access to the seekTo
instance method as per the documentation demo source code. I can't seem to get the type to work - I'm kinda new to typescript and probably going about this wrong so any pointers would be helpful! I've looked at the react-player index.d.ts and can see the function is listed there, just need to know how I'm supposed to be writing this in.
Expected Behavior
Have access to the instance methods of the player.
Error
Property 'seekTo' does not exist on type 'MutableRefObject<ReactPlayer | null>'.ts(2339)
Steps to Reproduce
I made a small codeSandbox - basically trying to mimic the demo source for adding a ref to utilise the seekTo
method onMouseUp
on a range type input.
https://codesandbox.io/s/react-typescript-lqgvr?file=/src/index.tsx
Thanks!