Commit Graph

957 Commits

Author SHA1 Message Date
Arshita Kakkar
5fc494752c Doc error (#2301)
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. "
2020-03-09 13:35:18 +00:00
Arshita Kakkar
cc007751ca Documentation correction (#2304)
* 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>
2020-03-09 13:34:04 +00:00
Conrad Beach
257a7dbca3 Fix Typo in Lifting State Up Docs (#2395)
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.
2020-03-09 13:24:47 +00:00
Tom Beckenhauer
e3a6479989 Update legacy lifecycle methods (#2435)
* Update legacy lifecycle methods

componentWillReceiveProps -> componentDidUpdate

* Update legacy lifecycle methods

componentWillReceiveProps -> componentDidUpdate

* Update higher-order-components.md

Co-authored-by: Sunil Pai <threepointone@oculus.com>
2020-03-09 13:16:24 +00:00
Juan M. Rinaudo
ec355d122f add missing word (#2479)
Co-authored-by: Juan Manuel Rinaudo <juan.rinaudo@jemstep.com>
Co-authored-by: Sunil Pai <threepointone@fb.com>
2020-03-09 13:06:51 +00:00
Kevin Sullivan
705cacfa70 Update concurrent-mode-suspense.md (#2495)
According to [ProofreadNOW](https://www.proofreadnow.com/blog/bid/101485/If-I-Were-or-If-I-Was-Which-is-Correct),
> Guideline: Use were (instead of was) in statements that are contrary to fact.
2020-03-09 13:03:31 +00:00
项鸿伟
7c28a3e88a Update testing-recipes.md (#2509)
Missing code
2020-03-09 13:02:00 +00:00
David Cho-Lerat
81681dda2a Fix small typo in concurrent-mode-adoption.md (#2531)
"You can use in new code" => "You can use them in new code"
2020-03-09 12:55:30 +00:00
Matt Wood
a1f0f84a1f Update components docs for functional components (#2547)
* Update components docs for functional components

* Update components-and-props.md

Co-authored-by: Sunil Pai <threepointone@oculus.com>
2020-03-09 12:52:33 +00:00
David Cho-Lerat
778ddf16a2 Fix small typo in concurrent-mode-reference.md (#2533)
`MySlowList` "lag behind" => `MySlowList` "lags behind"
2020-03-09 12:49:50 +00:00
amdwit
70826654df Update components-and-props.md (#2601) 2020-03-09 12:33:38 +00:00
Sergei Cherniaev
922daf1add typo fix, double spaces (#2608) 2020-03-09 12:33:04 +00:00
mknapper1
fe5ec2c55d Fix typo in hooks-faq.md (#2649)
* Fix typo in hooks-faq.md

* Update hooks-faq.md

* Update hooks-faq.md

Co-authored-by: Sophie Alpert <git@sophiebits.com>
Co-authored-by: Sunil Pai <threepointone@oculus.com>
2020-03-09 12:21:12 +00:00
Aviv Hadar
602bfb5eda Update hooks-reference.md (#2691)
Clarifying  a useState sentence
2020-03-09 12:08:46 +00:00
Abdulaziz Sirojiddinov
0c6d760ab5 adding next section url path (#2742)
adding next section URL path at the end in order to ease readers follow steps
2020-03-09 12:02:22 +00:00
Sunil Pai
87b4a4fac7 Revert "added stackblitz to playground (#2759)" (#2820)
This reverts commit 869c740a88.
2020-03-09 11:56:39 +00:00
Pato
869c740a88 added stackblitz to playground (#2759)
* added stackblitz to playground

* modified link of Stackblitz

I changed the link based on comment from @EricSimons
2020-03-09 11:56:15 +00:00
J Zhong
bbc6419a36 Add link to download node.js in Create React App (#2787) 2020-03-09 11:44:55 +00:00
Muhammad Arslan Sajid
69b15a2117 update hooks-faq.md (#2806)
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?"
2020-03-09 11:36:19 +00:00
Sunil Pai
c9b76e9795 fix test renderer's act() example (#2811)
`<renderer>.update()` doesn't return anything
2020-03-04 12:48:44 +00:00
Sunil Pai
60d83be9be Add shouldComponentUpdate to list of methods double called in Strict Mode (#2810)
This landed in 16.13 via https://github.com/facebook/react/pull/17942
2020-03-04 12:34:58 +00:00
Luis Filipe
a9ab627e09 Update rendering-elements.md (#2804)
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
2020-03-03 18:33:16 -08:00
Dan Abramov
c1d4960a2a Remove shallow renderer from website navigation (#2785)
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.
2020-02-27 18:19:33 +00:00
Sean McPherson
770cb59d6c Use semantic button for event handler example (#2781)
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.
2020-02-26 15:31:43 -08:00
James Cool
bba6229e90 Fix broken link (#2776)
* Fix broken link

* change underscores to hyphens

Previous fix not correct. This actually fixes the link.
2020-02-24 13:27:06 -08:00
Patrick Smith
0741c81a14 "async" mode to "concurrent" mode (#2761)
Should hooks such as `useLayoutEffect`, `useEffect`, etc also be listed in the "Render phase lifecycles" section?
2020-02-20 09:17:03 -08:00
Jamie Dixon
2746927f56 Add the word 'a' to 'whole seven seconds' to complete sentence (#2757) 2020-02-20 09:00:38 +03:00
Levi Notik
9fea635692 Minor grammatical fix (#2747)
Change 

> node whose contents has changed 

to

> node whose contents have changed
2020-02-18 12:51:35 -08:00
Kin Lum
285902c381 "Here" as the title for link has no semantics (#2751)
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.
2020-02-18 12:43:07 -08:00
Jakub Drozdek
4367566bdd Remove part about stateless components (#2694) 2020-02-09 15:41:06 -08:00
Sophie Alpert
c9fe940cb0 Update faq-versioning.md
It's 2020 already.
2020-02-08 15:09:29 -08:00
numb86
4fae9e8905 Fix internal link (#2668) 2020-02-03 14:53:12 -08:00
Nicolas Gallagher
a79f91124f Update docs on how to contribute (#2696)
* Remove outdated content.
* Add JDK installation requirement
2020-01-21 13:38:45 -08:00
yoeldovidcohen
c8aef5dc0d Got this warning when using the former version (#2693)
The --typescript option has been deprecated and will be removed in a future release.
In future, please use --template typescript.
2020-01-20 18:41:14 +03:00
Dan Green
d7e9a52d7d Updated strict-mode docs to use UNSAFE_* lifecycle method names (#2683)
* 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>
2020-01-16 09:21:09 -08:00
Christoph Nakazawa
aa8f663693 Change very visible to noticeably (#2679)
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
2020-01-15 11:55:05 +00:00
Rasmus Nilsson
3f64033e6e Fix grammar (#2676) 2020-01-14 14:29:56 -08:00
David Cho-Lerat
99a18287c1 Update testing-environments.md (#2665)
Remove extraneous "both"
2020-01-11 21:09:23 -08:00
Ben Schwarz
dedacfbc53 Updated URL to react performance article (#2670) 2020-01-11 21:06:31 -08:00
numb86
1e4159d11d Fix sample test code (#2648) 2020-01-06 14:15:33 -10:00
Evrim Persembe
24ebabd01e Update "Refs and the DOM" documentation (#2657)
* Update "Refs and the DOM" documentation

As function components can now have state through hooks, remove the part that mentions converting a function component to a class component to be able to use state.

* Update refs-and-the-dom.md

Co-authored-by: Sophie Alpert <git@sophiebits.com>
2020-01-06 14:11:05 -10:00
Vinoth Kumar
071f5b0e16 Update introducing-jsx.md (#2660)
* Update introducing-jsx.md

* Fix formatting

Co-authored-by: Sophie Alpert <git@sophiebits.com>
2020-01-05 19:38:47 -10:00
Vinoth Kumar
f2cffb8ca4 Link is not working (Domain expried) (#2636) 2020-01-05 16:25:11 -10:00
Anthony Valera
fc0e690b4e Changes variable declarations in code examples (#2345)
Converts a few `let` declarations for constant values to `const` in code examples
2020-01-03 01:53:52 +03:00
Sophie Alpert
6788666b0d Make link text for toolchain setup clearer
Fixes #2437.
2020-01-01 08:53:11 -08:00
Sophie Alpert
1e4023ed7d Add note about skipped updates with noop setState
Fixes #2599.
2020-01-01 08:40:36 -08:00
Sophie Alpert
f2920cc67b Amend DOM measurement hooks example to be clear about shortcomings
Fixes #2556.
2020-01-01 08:32:01 -08:00
Gergely Pap
4908a2f577 Update hooks-rules.md (#2647)
Updated information on ESLint plugin being included in Create React App.
2020-01-01 18:06:31 +03:00
jarstelfox
f90d199a61 Memo: Document behavior with useContext (#2332)
* Memo: Document behavior with useContext

It is not obvious that useContext and Memo work well together. Namely, if a child component listens to a context and updates out from under them memo'd function, does the memo'd component have the right state if re-rendered?

yes, actually. but this is undocumented. Now it's not!

* fix typo tigger -> trigger

* Add more detail to all relevant pages

Co-authored-by: Alex Krolick <alexkrolick@users.noreply.github.com>
Co-authored-by: Sophie Alpert <git@sophiebits.com>
2019-12-31 13:51:08 -08:00
Toru Kobayashi
5b6ad38880 prefer https to http for links (#2643) 2019-12-28 01:38:55 +03:00