I have changed my es6 classes to functions, and now get the above error when I try and dispatch an action in my child component, passed down as a prop. Any ideas?
Container:
import {bookmarkVideo} from '../actions/videos';
export default function VideoPlayerScreen(props) {
const dispatch = useDispatch();
...
const bookmarkVideo = id => {
dispatch(bookmarkVideo(id));
navigate('Video Player');
};
return (
<>
<VideoPlayerHeader
{...videoProps}
onClick={bookmarkVideo}
/>
...
</View>
Child:
export default function VideoPlayerHeader(props) {
let {title, bookMarked, icon, id, onClick} = props;
return (
<View style={styles.rightContainer}>
<TouchableHighlight onPress={() => onClick(id)}> // dispatch action
Videos.js:
export const bookmarkVideo = video => ({
type: "BOOKMARK_VIDEO",
video
});