I’m trying to put a video inside the accordion, but this error appears( Invalid hook call. Hooks can only be called inside of the body of a function component.This could happen for one of the following reasons:
-
You might have mismatching versions of React and the renderer (such as React DOM)
-
You might be breaking the Rules of Hooks
-
You might have more than one copy of React in the same app
). Can someone help me please
this is my code:import React, {Component} from 'react'; import {View, StyleSheet, Button} from 'react-native'; import {Accordion, Block} from 'galio-framework'; import { Video } from 'expo-av'; export default class Ajuda extends Component { constructor(props) { super(props); this.state = { data: [ { title: 'Desengasgar', content: <View> <Video ref={video} style={styles.video} source={require("./videos/ferida.mp4")} useNativeControls resizeMode="contain" isLooping onPlaybackStatusUpdate={setStatus} /> </View>, }, ], }; } render() { return ( <View style={styles.container}> <Block style={styles.block}> <Accordion dataArray={this.state.data} opened={null} /> </Block> </View> ); } }