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.
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.
A page could have 50 links, every one with the link text "Here" and it doesn't mean anything.
Search engines rely on the fact that the link text says something about the link. The text "Here" doesn't mean anything to search engines. Using "Here" as link text has no semantic value.
* Updated strict-mode docs to use UNSAFE_ method names
The strict mode docs still reference the old `componentWill*` lifecycle method names, this updates them to be `UNSAFE_componentWill*`
* Tweaked docs to mention both unsafe lifecycle names
Co-authored-by: Brian Vaughn <brian.david.vaughn@gmail.com>
I believe the text in this paragraph is meant to say `visibly` but that alone is not expressive enough so `very` was added in front. I believe the correct unambiguous word to use here should be `noticeably`.
cc @gaearon