Skip to content
This repository has been archived by the owner on Oct 28, 2018. It is now read-only.

React warnings #11

Closed
ivan-kleshnin opened this issue Nov 28, 2017 · 4 comments
Closed

React warnings #11

ivan-kleshnin opened this issue Nov 28, 2017 · 4 comments
Assignees

Comments

@ivan-kleshnin
Copy link
Owner

ivan-kleshnin commented Nov 28, 2017

React raises a warning for fields with value but without onChange. It's not applicable for our architecture. The current workaround is:

<input type="text" name="filter.tag" value={index.filter.tag} onChange={R.id}/> Tag

Need to suppress this warning in a single place.


Consider the following.

// Should suppress DevTool warning since React 16.1.0
// plugins: [
//   new Webpack.DefinePlugin({
//     "__REACT_DEVTOOLS_GLOBAL_HOOK__": "({ isDisabled: true })"
//   }),
// ]

React 16.1.1 is released.

@scabbiaza
Copy link
Collaborator

scabbiaza commented Nov 29, 2017

  1. Ongoing discussion -- Inaccurate warning when value props is set without onChange. facebook/react#1118

  2. React Tools warning

After some research found the same solution.
This is funny:
facebook/react#3877 (comment)

  1. Also, this can be useful, new feature in React 16.1.0
    Add a new suppressHydrationWarning attribute for intentional client/server text mismatches.

screen shot 2017-11-29 at 19 58 47

@ivan-kleshnin
Copy link
Owner Author

ivan-kleshnin commented Nov 29, 2017

When you're starting to add attributes like suppressHydrationWarning – it's a bad sign. Warnings should be 100% relevant or they should be removed.

@scabbiaza
Copy link
Collaborator

Update about the warning
warning.js:33 Warning: Expected server HTML to contain a matching <div> in <div>.

Without SSR we should not use hydrate method, or this warning will be shown

@ivan-kleshnin
Copy link
Owner Author

Done, as much as it's possible right now.

@ivan-kleshnin ivan-kleshnin self-assigned this Dec 20, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants