I have problem with react-select. When I type some text in searchable input and click outside, my text is disappear.
I tried onBlur={() => input.onBlur({value: input.value})} and it works fine but I have ugly errors in console. Something like Uncaught ReferenceError: input is not defined.
onChangeValue = (newValue) => {
const inputValue = newValue.replace(/\W/g, '');
this.setState({ inputValue });
this.props.nameFilter(inputValue);
};
handleCloseMenu = () => {
this.setState(({
menuIsOpen: false,
}))
input.onBlur(input.value)
};
handleOpenMenu = () => {
this.setState(({
menuIsOpen: true,
}))
input.onBlur(input.value)
};
render() {
return (
)};
};
Is there any workaround without using redux-form?
The same problem like here but I am not using redux-form and those solutions doesn't work.