Commit Graph

130 Commits

Author SHA1 Message Date
dan
a7d2254e0d Update more examples for 18 (#4607)
* Update more examples for 18

* blargh
2022-04-27 20:12:07 +01:00
Ricky
74246c13b9 React 18 (#4499)
* [18] ReactDOM reference to createRoot/hydrateRoot (#4340)

* [18] ReactDOM reference to createRoot/hydrateRoot

* Update note about render and hydrate

* Match the warning text

* s/Render/render

* [18] Update ReactDOMClient docs (#4468)

* [18] Update ReactDOMClient docs

* Remove ReactDOMClient where it's obvious

* Update browser message

* Update browser message note

* Update based on feedback

* Add react-dom/client docs

* [18] Upgrade homepage examples (#4469)

* [18] Switch code samples to createRoot (#4470)

* [18] Switch code samples to createRoot

* Feedback fixes

* Feedback updates

* [18] Use hydrateRoot and root.unmount. (#4473)

* [18] Add docs for flushSync (#4474)

* [18] Add flushSync to ReactDOM docs

* Seb feedback

* More Seb feedback

* [18] Bump version to 18 (#4478)

* [18] Update browser requirements (#4476)

* [18] Update browser requirements

* Update based on feedback

* [18] Add stubs for new API references (#4477)

* [18] Add stubs for new API references

* Change order/grouping

* [18] Redirect outdated Concurrent Mode docs (#4481)

* [18] Redirect outdated Concurrent Mode docs

* Use Vercel redirects instead

* [18] Update versions page (#4482)

* [18] Update version page

* Fix prettier

* [18] Update React.lazy docs (#4483)

* [18] Add docs for useSyncExternalStore (#4487)

* [18] Add docs for useSyncExternalStore

* rm "optional"

* [18] Add docs for useInsertionEffect (#4486)

* [18] Add docs for useId (#4488)

* [18] Add docs for useId

* Update based on feedback

* Add Strict Effects to Strict Mode (#4362)

* Add Strict Effects to Strict Mode

* Update with new thinking

* [18] Update docs for useEffect timing (#4498)

* [18] Add docs for useDeferredValue (#4497)

* [18] Update suspense docs for unexpected fallbacks (#4500)

* [18] Update suspense docs for unexpected fallbacks

* Add inline code block

* Feedback fixes

* [18] Updated Suspense doc with behavior during SSR and Hydration (#4484)

* update wording

* wording

* update events

* Update content/docs/reference-react.md

Co-authored-by: Sebastian Silbermann <silbermann.sebastian@gmail.com>

* add link to selective hydration

* remove some of the implementation details

Co-authored-by: Sebastian Silbermann <silbermann.sebastian@gmail.com>

* [18] renderToPipeableStream doc (#4485)

* new streaming ssr api

* add readable stream

* code snippets

* Rename strict effects / unsafe effects to use the reusable state terminology (#4505)

* Add draft of 18 release post

* Add links to speaker Twitter profiles

* [18] Update upgrade guide

* Fix typo in blog title

* [18] Blog - add note for react native

* [18] Add changelog info to blog posts

* Edit Suspense for data fetching section

* Update date

* [18] Add links

* Consistent title case

* Update link to merged RFC

* [18] Update APIs and links

* [18] Add start/useTransition docs (#4479)

* [18] Add start/useTransition docs

* Updates based on feedback

* [18] Generate heading IDs

* Add note about Strict Mode

* Just frameworks

* Reorder, fix content

* Typos

* Clarify Suspense frameworks section

* Revert lost changes that happened when I undo-ed in my editor

Co-authored-by: salazarm <salazarm@users.noreply.github.com>
Co-authored-by: Sebastian Silbermann <silbermann.sebastian@gmail.com>
Co-authored-by: Sebastian Markbåge <sebastian@calyptus.eu>
Co-authored-by: Andrew Clark <git@andrewclark.io>
Co-authored-by: dan <dan.abramov@gmail.com>
2022-03-29 12:03:23 -04:00
Niklas P
49fd7d5f11 Update reference-caveats-solution.js (#3609)
As referenced in https://reactjs.org/docs/context.html update the example to use the naming conventions used across the page.
2021-04-05 11:31:03 +02:00
Charlie Stras
6ff9c4bd06 Fix incorrect highlighting in uncontrolled components example (#2873) 2020-03-31 11:14:31 -07:00
Fran Zekan
91ffdb0812 Upgrade to Node 12 LTS (#2831)
* Upgrade to node 12 LTS

* Run prettier
2020-03-14 13:24:39 +00:00
Ruslan Petrov
d58c947b1e Update motivation-solution.js (#1625)
Removed unused props for clarity.
2020-03-09 16:06:53 +00:00
Ruslan Petrov
16647b39e6 Update reference-caveats-problem.js (#1626)
Added MyContext for clarity.
2020-03-09 16:02:47 +00:00
Sebastian Markbåge
896214b7d2 Document class contextType as the primary consuming mechanism (#1283)
* Document class contextType as the primary consuming mechanism

* Update context.md
2018-10-23 16:48:02 -07:00
Michał Gołębiowski-Owczarek
06a8850b2f HTTPS-ify lots of URLs, update some to their newer homes (#1157)
This matters for user security.

I didn't touch blog posts & pages related to past conferences.

The `content/docs` could be HTTPS-ified as well but it contains lots of HTTP
links so maybe that'd be best done in a separate PR.
2018-10-05 14:39:12 -07:00
Alexander Nanberg
71b03486c0 Upgrade to Gatsby v2 (#1104)
* Upgrade to Gatsby v2

* Remove unnecessary polyfills since gatsby already provides them

* Move global styles to gatsby-browser

* Add fb comment and convert to cjs

* Revert to use pageQuery again

* Add back html.js

* Update dependencies

* Move TitleAndMetaTags

* Replace glamor/reset with normalize.css which fixes style order in prod

* Prettier formatting

* Remove unused types

* Remove old layout

* Fix versions link

* Update deps

* Update deps

* Remove hack since it's no longer needed

* Update dependencies

* Fix build error

* Fix prettier config resolution

* Update gatsby

* Remove custom onCreatePage logic

* Update dependencies

* Fix build

* Update dependencies

* prettier formatting

* update dependencies

* add custom babel config for flow

* upgrade dependencies

* update dependencies

* use stable gatsby release
2018-09-19 13:11:19 +01:00
Tanyoung Kim
83fd04aa81 Update example function name in Async blog post (#1183) 2018-09-14 23:22:49 +01:00
Nathan Quarles
392d5bfdcd Update lifecycles.js (#1098)
`theme ? 'dark' : 'light'` will always use the dark theme no matter what it's set to in context. Guessing this is not what was intended? This PR fixes it.
2018-07-27 13:32:12 -07:00
Dan
3d38ca4724 Fix CI 2018-06-23 01:42:26 +01:00
Rodrigo Bermúdez Schettino
24f0448d7c Update Ref API in docs (#970)
* Update Ref API in docs

Update to new React.createRef() API in guide "Uncontrolled Components".

* Update Ref API in doc example

Use new Ref API in guide's example.

* Fix syntax error in example

* Update highlighting ranges in docs

After updating to the new createRef API, the highlighting ranges in Uncontrolled Components were wrong.

* Update highlighting ranges in docs example

After updating to the new createRef API, the highlighting ranges in Uncontrolled Components were wrong.

* Update highlighting ranges in docs example

Remove empty line in source code.

* Update uncontrolled-components.md

* Update input-type-file.js
2018-06-22 12:08:03 +01:00
Brian Vaughn
3e80980c18 Renamed params for gDSFP 2018-05-24 18:18:04 -07:00
Andrew Clark
30be0d05fa Add back pointer events example 2018-05-23 17:55:32 -07:00
Andrew Clark
55b251146d Add pointer events example 2018-05-23 16:44:44 -07:00
Travis Arnold
fc99015393 swap example theme colors (#851) 2018-04-29 16:23:25 -07:00
Brian Vaughn
cad9c0e424 Prettier 2018-04-18 09:59:41 -07:00
Dan Abramov
e32847f030 Add a defaultValue for context example 2018-04-18 17:23:12 +01:00
Lucas Duailibe
dab9b8b2fd Add 'visual components' use case for forwarding refs (#798)
* Add 'visual components' use case for forwarding refs

* Rearrange "forwarding refs" to focus on simple use case

* Minor wording nits to 2018-03-29-react-v-16-3.md

* Minor wording nits to forwarding-refs.md

* Add more info to the forwardRef reference doc

* Minor wording nits to reference-react.md
2018-04-13 17:23:19 +01:00
Brian Vaughn
7351d11a89 Fixed invalid getSnapshotBeforeUpdate() example code (#799)
* Fixed invalid getSnapshotBeforeUpdate() example code

* Don't use class properties in stable docs
2018-04-13 14:41:27 +01:00
Brian Vaughn
d453c2c8fb Merge pull request #767 from koba04/customizing-display-name-ref-forwarding
Add a section "Customizing Name in DevTools" in Forwarding Refs
2018-04-11 08:17:28 -07:00
Toru Kobayashi
f450adbdec Add a section "Displaying a custom name in DevTools" 2018-04-11 11:56:17 +09:00
Dan Abramov
7ab54e2928 Remove too much highlighting in a small snippet 2018-04-09 19:26:30 +01:00
tjallingt
6521a654cb Added updating nested context default value example (#780)
* added context default value example

* Implement suggested change

* noop function as default value to createContext
2018-04-09 11:12:02 -07:00
Brian Vaughn
5ba8e04f26 Merge pull request #748 from tgallacher/fix/blog-react-v-16-3
Fix: added missing component instantiation within the 'forwardRef' AP…
2018-04-08 11:15:57 -07:00
tjallingt
e4941f6440 Added example for updating nested context consumer (#776)
* Added an example showing how to update the context from inside a (deeply) nested component

* Wrap comments

* Wrap comments

* Tweak wording

* Prettier

* Prettier

* Typo: "funtion" -> "function"
2018-04-06 18:49:55 -07:00
Brian Vaughn
c4bf6b087a Merge pull request #764 from bvaughn/react-lifecycles-compat-v2
Updated react-lifecycles-compat example to show 2.0 named export
2018-04-04 19:58:01 -07:00
Dan Abramov
f7cf140607 Tweak context docs (#766) 2018-04-04 15:21:16 +01:00
Brian Vaughn
ec718a33ee Updated react-lifecycles-compat example to show 2.0 named export 2018-04-03 10:33:37 -07:00
Brian Vaughn
4a2a8541cb Merge pull request #738 from koba04/forward-ref-examples
React.forwardRef accepts a render function, not Functional Component
2018-04-02 10:43:58 -07:00
Toru Kobayashi
0ea7d99127 Revert "Adopt bvaughn's example"
This reverts commit 2e1554dc32.
2018-04-03 02:36:43 +09:00
Toru Kobayashi
2e1554dc32 Adopt bvaughn's example 2018-04-03 02:02:45 +09:00
Chanyeon Kim
e8cdf5128a Fix button => themed-buton (#752) 2018-04-01 14:10:34 +01:00
Tom Gallacher
17d04ac9f3 Fix: added missing component instantiation within the 'forwardRef' API example 2018-03-31 19:10:54 +01:00
Pat
e61d594b64 Minor: context/theme-detailed-app.js broken (#746)
* Minor: context/theme-detailed-app.js broken

Today I tested out the new Context API using using [CRA](https://github.com/facebook/create-react-app). 
I encountered a runtime exception, so this tiny PR is intended to make it easier for future Context API learners.

`ReferenceError: Must call super constructor in derived class before accessing 'this' or returning from derived constructor`

create-react-app@next commit da518d2238298dd5db74e9c63c12251099f87bb0

* Update theme-detailed-app.js
2018-03-30 22:07:34 +01:00
Nathan Quarles
51a864d858 Fix cDU to correctly make async request
When a new `id` prop is passed in, `getDerivedStateFromProps` sets `this.state.externalData` to `null`. If I understand the new API correctly the return value of gDSFP() either becomes the new state or is merged into the new state? If so, then `componentDidUpdate` should examine the new state (`this.state.externalData`), not `prevState.externalData`.
2018-03-30 11:44:46 -04:00
Christian Maughan Tegnér
b1d705ad60 Use correct component name in context doc example (#740)
* Use correct component name in context doc example

I'm assuming the intention was to reference the `FancyButton` component defined directly above, unless I'm misunderstanding how to read this example.

* Prettier
2018-03-30 15:08:36 +01:00
Toru Kobayashi
c72935a054 prettier 2018-03-30 15:25:16 +09:00
Toru Kobayashi
d5c449d824 React.forwardRef accepts a render function, not Functional Component 2018-03-30 14:14:29 +09:00
Brian Vaughn
73ba23fccd Updated createRef example not to use class property syntax 2018-03-29 14:56:43 -07:00
Brian Vaughn
3a36a402a5 Revert "Added inline child function caveat to Context docs"
This reverts commit 691cd4577c.
2018-03-29 09:24:43 -07:00
Brian Vaughn
797a792b77 Revert "Prettier"
This reverts commit 032576cf7b.
2018-03-29 09:24:38 -07:00
Brian Vaughn
032576cf7b Prettier 2018-03-29 09:18:46 -07:00
Brian Vaughn
691cd4577c Added inline child function caveat to Context docs 2018-03-29 09:15:30 -07:00
Brian Vaughn
a29098e958 Merge branch 'master' into 16.3-release-blog-post 2018-03-28 11:00:55 -07:00
Brian Vaughn
6afbc7b56e Added side effects props change example 2018-03-28 10:27:36 -07:00
Brian Vaughn
9113b4c829 Fixed example props/prevProps 2018-03-27 19:24:52 -07:00
Dan Abramov
77dae36663 Use examples without types in the post (#719) 2018-03-28 00:40:13 +01:00