我想在我的 Node JS 应用程序中使用Geocomplete (Github 示例),一个 JQuery 插件。我对网络应用程序相当陌生,并且无法弄清楚如何集成 JQuery 的东西。
我正在渲染我的页面:
render() {
let { input } = this.state;
return (
<div className="row">
<div className="col s12">
<h4>Welcome!</h4>
<input
id="geocomplete"
placeholder="Enter a search location”
type="text"
onChange={this.onInputChange.bind(this)}
value={input} />
<a
onClick={this.onSearchClick.bind(this)}
className='waves-effect waves-light btn'>Search!</a>
</div>
</div>
)
}
该示例显示执行以下操作:
$("#geocomplete").geocomplete()
但我似乎无法在渲染()中做到这一点,所以我不确定如何。有任何想法吗?
谢谢!