We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have Typeahed object with defaultValue prop. In componentDidMount I receive new value and call setState but defaultValue doesn't change.
The text was updated successfully, but these errors were encountered:
same problem here
Sorry, something went wrong.
You may be falling for https://facebook.github.io/react/tips/props-in-getInitialState-as-anti-pattern.html . There's an unofficial API for setting the text: https://github.com/fmoo/react-typeahead/blob/master/src/typeahead/index.js#L108 I don't exactly know how it works in your case for componentDidMount, but for componentDidUpdate, something like this should work:
componentDidUpdate (prevProps, prevState){ if (this.props.text != prevProps.text) { this.refs.MyTokenizer.setEntryText(this.props.text);} }
I'd love a readme update PR if you get that working.
No branches or pull requests
I have Typeahed object with defaultValue prop. In componentDidMount I receive new value and call setState but defaultValue doesn't change.
The text was updated successfully, but these errors were encountered: