I have problem when get playbackState.
This is my code
`import TrackPlayer, { usePlaybackState } from 'react-native-track-player';
const playbackState = usePlaybackState();`
usePlaybackState is a recent feature which has not been released yet. You'll not be able to use it just yet unless you're in the latest dev branch.
May I ask why you have it in the example/ in the master branch if it uses dev modules and functions? @Guichaguri
This issue is quite old, and it has been released in 1.1.6 and newer.
@Guichaguri I'm using 1.1.8 and I'm still getting this error, can you explain? Thank you.
@jandog8990 +1
@jandog8990 +1
It's listed in the example folder and running a fresh project off the example crashes. This issue should be re-opened and resolved. I see it in the react-native-track-player/lib/hooks but still can't reference or load it.
Even updating to dev branch npm install --save react-native-kit/react-native-track-player#dev the same problem persists running the demo code.
100% guaranteed way to solve this issue is :
use like this "TrackPlayer.usePlaybackState() " instead of "import Trackplayer ,{usePlaybackState}"
it is all.
Most helpful comment
100% guaranteed way to solve this issue is :
use like this "TrackPlayer.usePlaybackState() " instead of "import Trackplayer ,{usePlaybackState}"
it is all.