【发布时间】:2018-10-31 10:54:15
【问题描述】:
我遵循了关于tooltips 的代码示例 在 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,一切正常。 但是我希望在用户加载页面时显示工具提示...
我该怎么办?
【问题讨论】:
标签: reactjs reactstrap