).
аюсь использовать ссылки React для фокусировки поля Redux-Form при его монтировании.
Когда я пытаюсьthis.refs.title.getRenderedComponent().focus()
вcomponentDidMount
выдается ошибка, говорящая:
edit_fund.js:77 Uncaught TypeError: Cannot read property 'getRenderedComponent' of undefined
Когда я console.log this.refs, это в основном пустой объект и иногда идентифицирует «title» как ссылку, но это не надежно.
Я неправильно использую ссылки? Мой код ниже для справки.
componentDidMount = () => {
this.refs.title
.getRenderedComponent()
.focus();
}
...
<Field
id="title"
name="title"
component={FormInput}
type="text"
ref="title" withRef
/>