komal deep singh chahal komal deep singh chahal - 1 year ago 670
React JSX Question

Router link giving warning " link is a void element tag and must not have `children` or use `props.dangerouslySetInnerHTML`."

I am using react-route first time.
when i am trying this, it gives me this warning and its not working
"Warning: link is a void element tag and must not have

or use
. Check the render method of Loginpanel."

my code is like this.

render() {

return (

<div >

<input type="email" />
<input type="password"/><br/>

<link to="Index"> BLOCK



and my main main.js is like this

<Router history={hashHistory}>

<Route path="/" component={Loginpanel} >
<Route path="Index" component={App}/>
<Route path="Form" component={Form} />


Thanks in advance.

Answer Source

In reactjs its Link and not link. Can you try that once?

import {Link} from 'react-router';
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download