-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
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
Warning on Input Component #135
Comments
I'm having the same issue, any suggestions? |
I'm afraid I've not seen this myself, could you let me know which React version you are using? |
I'm using React 16.3.2 |
@i-like-robots I am also getting this problem. |
I added a PR to change to defaultValue, but if you want a hack that avoids the warning until this is fixed, you can add a noop method to your class that uses ReactTags and reference it as the onChange for your component. It's ugly, but it will stop the warnings. noOp() {
// does nothing
}
<ReactTags
tags={this.state.tags}
suggestions={this.state.suggestions}
handleAddition={this.handleTagAddition}
handleDelete={this.handleTagDelete}
inputAttributes={{ onChange: this.noOp }}
/> |
This is an interesting issue, it was discussed at length some years back in facebook/react#1118 (although I've never seen this warning, with any version of React including 16.3.2!) There is nothing technically wrong with the current implementation but I agree warnings cluttering up the console are annoying and should be avoided. I'm not sure that setting |
Looking into this some more I can see that this warning has 5 conditions: It is the first condition which interests me because by default this should evaluate to Therefore to trigger this warning I had to change the default state (https://github.com/i-like-robots/react-tags/blob/master/lib/ReactTags.js#L35) to make it a truthy value. Do any of you who are experiencing have an example which demonstrates the issue so I can look more closely at it? |
I am having a warning using
ReactTags
:From what is said here we should probably change https://github.com/i-like-robots/react-tags/blob/master/lib/Input.js#L78 by something like:
defaultValue={query}
What do you think?
Thanks!
The text was updated successfully, but these errors were encountered: