我遵循了有关 Reactstrap 中工具提示的代码示例:
constructor(props) {
super(props);
this.state = {
tooltipOpen: true
};
}
.
.
.
render() {
return (
<div>
<p>Somewhere in here is a <a href="#" id="TooltipExample">tooltip</a>.</p>
<Tooltip
placement="right"
isOpen={this.state.tooltipOpen}
target="TooltipExample"
toggle={this.toggle}>
Hello world!
</Tooltip>
</div>
)
}
我收到以下错误:
错误:无法在 dom 中识别目标“TooltipExample”,提示:检查拼写
如果初始状态为 ,则一切正常tooltipOpen: false
。但是我希望在用户加载页面时出现工具提示...
我该怎么办?