我第一次使用React-Router。当我尝试使用它时,出现了以下警告并且它不能正常工作:"Warning: link is a void element tag and must not have children
or use props.dangerouslySetInnerHTML
. Check the render method of Loginpanel."
我的代码如下。
render() {
return (
<div >
<input type="email" />
<input type="password"/><br/>
<link to="Index"> BLOCK
</link>
</div>
)
}
}
我的主要 main.js 文件如下
render(
<Router history={hashHistory}>
<Route path="/" component={Loginpanel} >
<Route path="Index" component={App}/>
<Route path="Form" component={Form} />
</Route>
</Router>,
document.getElementById('js-main'));
提前致谢。