Since persist() is referred to in the doc as a method for disabling event pooling, that must mean it's part of the SyntheticEvent API.
I'm proposing to state it more explicitly so that there's no doubt for newcomers like me whether it is the SyntheticEvent or the actual JS event that has the method.
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>
There's a line in the document that says:
"When it previously rendered, the `Calculator` has specified that"
The sentence is using a present tense verb ("has"), but the statement is in the past tense.
I think "When it previously rendered, the `Calculator` had specified that" would be correct.
* Update README.md (improve usability)
Clear up the ambiguous "Running locally" to the anchor link for better usability
* Update README.md
Co-authored-by: Sunil Pai <threepointone@oculus.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?"
Link each mention of a React API in rendering-elements.md to the reference docs.
On this page replace every static occurrence of `ReactDOM.render()` by link to the reference docs [`ReactDOM.render()`](/docs/react-dom.html#render)
Is this in the right direction @sophiebits ? 🤔
ref #2630
We still support it (and you can find this page in search), but we're transitioning away to community maintenance.
So we're deemphasizing it on the website.
As a general rule, `onClick` handlers should not be applied to non-interactive elements like a `div`. There is not substantive change to the code sample, but it doesn't provide a better example of semantic HTML for developers reading the documentation.