Commit Graph

975 Commits

Author SHA1 Message Date
Paul Henschel
6f322a438a Update conditional-rendering.md (#1175)
The ternary syntax using parenthesis was an unconventional prettier invention, going out of its way to format react ternaries differently from normal ternaries (if i remember correctly, because vim users had trouble re-formating without a mouse). If they made the right decision or not is one thing, but the additional noise could mislead beginners here, thinking they have to add more characters to make a simple 2-slot ternary, or that it is a "react thing".
2020-03-09 18:30:53 +00:00
Stephanie
7611c776fc Remove event from arrow function example (#1542) 2020-03-09 16:24:44 +00:00
Toru Kobayashi
331eb9db01 remove a reference to fbjs from codebase overview (#1806)
* remove a reference to fbjs from codebase overview

* Update codebase-overview.md

Co-authored-by: Sunil Pai <threepointone@oculus.com>
2020-03-09 15:40:40 +00:00
Sai Ram Kunala
348a5b2888 add suffix / to example url (#1861)
was inconsistent across examples
2020-03-09 15:27:31 +00:00
Amandeep Singh
fb382ccb13 Update render-props.md (#1940) 2020-03-09 15:02:50 +00:00
Carl A Lewis
6c108015ae Update code-splitting.md (#1972)
Added some clarity.
2020-03-09 14:54:30 +00:00
Raj Nigam
79d33dfe6e unused React import for hooks example (#1979)
I believe this was just from a copy/paste from the JSX example
2020-03-09 14:49:48 +00:00
shawn
3140018914 Update getting-started.md (#1991) 2020-03-09 14:40:52 +00:00
Sunil Pai
30749ed0b2 Revert "Revert "added stackblitz to playground (#2759)" (#2820)" (#2821)
This reverts commit 87b4a4fac7.
2020-03-09 14:17:59 +00:00
Myron Yeung
ba0818beab Fix ref creation in CustomTextInput component (#2072)
Change React.createRef() to useRef(null)
2020-03-09 14:06:19 +00:00
Gisli Nielsen
63a06196ba Changed what a component compiles to. (#2075) 2020-03-09 14:05:24 +00:00
Himanshu Pathak
c477cd79c8 animation plugin moved (#2091)
`react-addons-css-transition-group` moved to `react-transition-group`
2020-03-09 14:01:38 +00:00
Abel Regalado
be8775d4b9 [docs] Add missing events to docs/events page (#2123)
* [docs] Add missing evens to docs/events page

Added missing `onReset` event to Form Events –– (https://reactjs.org/docs/events.html#form-events)
Created Generic Events subsection, and added `onError` & `onLoad` events –– (https://reactjs.org/docs/events.html#generic-events)

Based on @sophiebits suggestion in following thread:
https://github.com/facebook/react/issues/1718#issuecomment-122622933

* [docs] Add event subsection to #supported-events

Added Generic Events subsection under Supported Events (https://reactjs.org/docs/events.html#supported-events)
2020-03-09 13:58:23 +00:00
tiffanymonroe
efeaea0606 added commas for clarification and grammar (#2133) 2020-03-09 13:54:51 +00:00
corinty
bc060f5edd Moved a bracket in the setState function example (#2164) 2020-03-09 13:52:38 +00:00
Vincent
b4e7437ceb Link to relevant forwardRef docs (#2229) 2020-03-09 13:48:48 +00:00
Rajinder Yadav
a35a95fb4b Handling Multiple Inputs (#2260)
Text says to use "__name__" but code shows usage of "__type__".
2020-03-09 13:45:57 +00:00
Steve Dodier-Lazaro
2c8f5695ba Add reference to persist to SyntheticEvent's API (#2274)
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.
2020-03-09 13:41:13 +00:00
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