I want to show different popovers on different listitems using reactstrap but on state change the property of popover become true and show all popovers are displayed rather than just one that i clicked.
//setting popoveropen:false initially
this.state = {
popoverOpen: false
};
//on click this toggle function runs which change the popoverOpen state to true which displays all the popover
toggle() {
this.setState({
popoverOpen: !this.state.popoverOpen
})
}
///这是jsx部分,在该部分中,我在列表项中使用了弹出窗口,单击后会运行切换功能并将popover的打开状态更改为true render(){ 返回( 会员 弹出标题 主体1
<ListGroupItem tag="button" id="Popover2" onClick=
{this.toggle2}>Labels<Popover placement="left" isOpen=
{this.state.popoverOpen}
target="Popover2" toggle={this.toggle}>
<PopoverHeader>Popover Title</PopoverHeader>
<PopoverBody>body2</PopoverBody>
</Popover>
</ListGroupItem>
</ListGroup>)}
just logic is missing in this code