Reputation: 710
I would like to make my redux-form fields 'active' by default. Is there a way to do this using RF v.6.5.0 ? Thank you!
Upvotes: 1
Views: 421
Reputation: 5450
At the moment I don't think there is a property to set on refux-form Field
s to set it to active by default. You can set it via refs once the component is mounted though.
Edit: Here might be a cleaner implementation using getRenderedComponent()
componentDidMount() {
this.refs.defaultInput
.getRenderedComponent()
.focus()
}
<Field name="defaultInput" ref="defaultInput" withRef component="input"/>
From redux-form Github There are a few other examples and link in that Github issue.
Upvotes: 2