Estoy usando un componente de clase, por lo que no puedo usar use const [index, setIndex] = React.useState(0); Estoy tratando de usar state & setState para rastrear index y handleChange (haciendo clic en una pestaña diferente.
this.state = { index: 0, } handleChange(newValue) { this.setState({ index: newValue, }); } <Tab value={index} onChange={this.handleChange} indicatorStyle={{ backgroundColor: 'white', height: 5, }} variant="primary"> <Tab.Item title="Blockchain" titleStyle={{fontSize: 12, fontWeight: 'bold'}} /> <Tab.Item title="NFT" titleStyle={{fontSize: 12, fontWeight: 'bold'}} /> <Tab.Item title="Gaming" titleStyle={{fontSize: 12, fontWeight: 'bold'}} /> </Tab> <TabView value={index} onChange={this.handleChange}> <TabView.Item style={{width: '100%'}}> <Text h1>Blockchain</Text> </TabView.Item> <TabView.Item style={{width: '100%'}}> <Text h1>NFTs</Text> </TabView.Item> <TabView.Item style={{width: '100%'}}> <Text h1>NFTs</Text> </TabView.Item> </TabView>