Changed Line 94- You can't use Hooks *inside* of a class component, but you can definitely mix classes and function components with Hooks in a single tree.
to
"You can't use Hooks *inside* a class component, but you can definitely mix classes and function components with Hooks in a single tree. "
* Documentation error
Line 290 - ". However, instead we recommend to split state into multiple state variables based on which values tend to change together."
Both 'however' and 'instead' are contrasting words and only one of them should be used.
Either "Instead we recommend to split state into multiple state variables based on which values tend to change together." OR "However, we recommend to split state into multiple state variables based on which values tend to change together."
Updated the sentence.
* Updated 'however' to 'instead'
Line 290 updated to -
Instead, **we recommend to split state into multiple state variables based on which values tend to change together.**
* Update hooks-faq.md
Co-authored-by: Sunil Pai <threepointone@fb.com>
1- Added getDerivedStateFromError lifecycle method to "Do Hooks cover all use cases for classes?"
2- Added getSnapshotBeforeUpdate lifecycle method to "How do lifecycle methods correspond to Hooks?"
In the example, `count` is initialized to 0 and then multiplied by 100... which is 0.
Changing this to addition so the previous value will differ from the current value.
For the FAQ question "Which versions of React include Hooks?", the current version of React Native (which supports Hooks) is now listed, along with a link to the blog post for that release.
* Links to React Redux hooks api
Since Hooks are already released for Redux, link the docs
* Update hooks-faq.md
Co-authored-by: Alexey Pyltsyn <lex61rus@gmail.com>
* Testing Docs
This expands the testing docs for reactjs.org. It adds 3 main docs -
- testing.md: An entry point to the testing docs
- testing-recipes.md: Common patterns when writing tests for React Components.
- testing-environments.md: Setting up your testing environment.
With help from @alexkrolick, @kentcdodds, @gaearon
* React Native added support for hooks in 0.59
React Native 0.59 and above already support React Hooks, this line is no longer necessary, causes confusion for some people that it is not working right now. We can also mention React Native version if needed.
* update with react native mention of hooks support
* Update content/docs/hooks-faq.md
suggested changes
Co-Authored-By: Alexey Pyltsyn <lex61rus@gmail.com>
* Update hooks-faq.md
I tripped up slightly while reading this example for using the callback form of a state setter inside an effect. I've added a few lines that might help a hook newbie grok the differences between the examples.
* Update hooks-faq.md
* Update hooks-faq.md
* inputs array > dependencies array
I think initially this was referred to as the "inputs array" in the docs, then it was changed to the "dependencies array" everywhere except it looks like a few were missed.
* inputs array > dependencies array
I think initially this was referred to as the "inputs array" in the docs, then it was changed to the "dependencies array" everywhere except it looks like a few were missed.
* Add more explanations to API page
* static
* add info about useLayoutEffect
* Update content/docs/hooks-reference.md
Co-Authored-By: gaearon <dan.abramov@gmail.com>
* nits
* nit