I'm using react-player to make a responsive web player app to get the stats about playedTime and all that stuff using a callback prop onProgress. But when I'm writing the code to useState, it gives a Parsing Error saying Unexpected Token, Expected ";" Also I am new to using GatsbyJs so if the error is because of that, I wouldn't have known. Here's my piece of code:-
const Lesson = () => {
const [watchComplete, setWatchComplete] = useState{false}
const handleWatchComplete = ({ played }) => {
console.log(played)
}
return (
<div>
<ResponsivePlayer
url="https://www.youtube.com/watch?v=ovJcsL7vyrk"
onProgress={handleWatchComplete}
/>
</div>
)
}
export default Lesson