https://codesandbox.io/s/pensive-kirch-21994p?file=/src/App.tsx
const playRef = useRef(null);
const playOrPause = () => {
setIsPlaying((prev) => {
if (playRef) {
playRef.current[prev ? "pause" : "play"]();
}
return !prev;
});
};
can someone please help me fix this type error
React.MutableRefObject<null>.current: null
Object is possibly 'null'.