I'm trying to pass props to a component using react router like so:
<Login
id={this.state.id}
password={this.state.password}
onChange={this.onChange}
onSubmit={this.onSubmit}
error={this.state.error}
/>
How do I do exactly that but with a react router, and how do I use it in the component itself?
I tried this but it doesn't work:
<Route
path="/"
component={Login}
components={{
id: this.state.id,
password: this.state.password,
onChange: this.onChange,
onSubmit: this.onSubmit,
error: this.state.error
}}
/>