I am using
"react-native-track-player": "^2.0.0-rc10", with
react-native 0.62.x
Build target: iOS
I am getting this error, I have tried importing it directly from the hook, without it. no luck.

Show us the code you are using
Looks like you are using the default export. This import should work.
import TrackPlayer, {usePlaybackState} from "react-native-track-player";
@Xammie I have the same import in my code.
import TrackPlayer, { usePlaybackState } from "react-native-track-player";
and this is how I am using usePlaybackState.
const playbackState = TrackPlayer.usePlaybackState();
this works on Android, but this is not working on ios. Please tell me if I am doing something wrong.
@EhteshamAnwar You are using the default export named TrackPlayer. You should use the hook like this. Hope this helps.
import TrackPlayer, { usePlaybackState } from "react-native-track-player";
function MyComponent() {
const state = usePlaybackState();
return (
...
)
}
Most helpful comment
@EhteshamAnwar You are using the default export named
TrackPlayer. You should use the hook like this. Hope this helps.