Toru Kobayashi
f450adbdec
Add a section "Displaying a custom name in DevTools"
7 years ago
Dan Abramov
7ab54e2928
Remove too much highlighting in a small snippet
7 years ago
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
7 years ago
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"
7 years ago
Dan Abramov
f7cf140607
Tweak context docs ( #766 )
7 years ago
Brian Vaughn
ec718a33ee
Updated react-lifecycles-compat example to show 2.0 named export
7 years ago
Toru Kobayashi
0ea7d99127
Revert "Adopt bvaughn's example"
This reverts commit 2e1554dc32
.
7 years ago
Toru Kobayashi
2e1554dc32
Adopt bvaughn's example
7 years ago
Chanyeon Kim
e8cdf5128a
Fix button => themed-buton ( #752 )
7 years ago
Tom Gallacher
17d04ac9f3
Fix: added missing component instantiation within the 'forwardRef' API example
7 years ago
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
7 years ago
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`.
7 years ago
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
7 years ago
Toru Kobayashi
c72935a054
prettier
7 years ago
Toru Kobayashi
d5c449d824
React.forwardRef accepts a render function, not Functional Component
7 years ago
Brian Vaughn
73ba23fccd
Updated createRef example not to use class property syntax
7 years ago
Brian Vaughn
3a36a402a5
Revert "Added inline child function caveat to Context docs"
This reverts commit 691cd4577c
.
7 years ago
Brian Vaughn
797a792b77
Revert "Prettier"
This reverts commit 032576cf7b
.
7 years ago
Brian Vaughn
032576cf7b
Prettier
7 years ago
Brian Vaughn
691cd4577c
Added inline child function caveat to Context docs
7 years ago
Brian Vaughn
6afbc7b56e
Added side effects props change example
7 years ago
Brian Vaughn
9113b4c829
Fixed example props/prevProps
7 years ago
Dan Abramov
77dae36663
Use examples without types in the post ( #719 )
7 years ago
Brian Vaughn
46103921fe
Changes in response to Sophie's feedback
7 years ago
Brian Vaughn
7cf5b58187
Wordsmithing
7 years ago
Brian Vaughn
e143823d7a
Added create-subscription example
7 years ago
Brian Vaughn
bd06bbc1a7
Added context HOC example to reference
7 years ago
Brian Vaughn
f11a149412
Added DevTools naming consideration to React.forwardRef reference doc example
7 years ago
Alex Krolick
8437e3767b
Fix syntax
7 years ago
Alex Krolick
b0e860404b
Prettier
7 years ago
Alex Krolick
349446d8a7
Add caveats section
7 years ago
Alex Krolick
920b4f4741
Replace divs with some fake components
7 years ago
Brian Vaughn
7ac0712ed8
Updated 16.3 blog post to account for getSnapshotBeforeUpdate lifecycle
7 years ago
Alex Krolick
69198013e1
Use functional component
7 years ago
Alex Krolick
fb8e9e8a1b
kill class props
7 years ago
Alex Krolick
f9225e2562
Remove propTypes
7 years ago
Alex Krolick
3c44882d68
Use function keyword
7 years ago
Brian Vaughn
b3bf0bd520
Added getSnapshotBeforeUpdate recipe
7 years ago
Brian Vaughn
c41bb29856
Added DevTools name consideration to forwardRef examples
7 years ago
Brian Vaughn
b25276a80e
Updated forward-refs example to use class component
7 years ago
Brian Vaughn
ef23c49e84
Updated multi-context example to show more indirection
7 years ago
Brian Vaughn
5864093674
Updated context-in-lifecycles example
7 years ago
Brian Vaughn
01c26919b4
Replaced cWRP in forwardRef example with cDU
7 years ago
Alex Krolick
9f5499789a
Update highlights
7 years ago
Alex Krolick
6eb29a18f5
Combine basic examples
7 years ago
Alex Krolick
7db107b2fc
+ "default value" comment
7 years ago
Alex Krolick
0d32f18b09
Kill highlight
7 years ago
Alex Krolick
7b5764fed5
Add ref forwarding, lifecycle examples
7 years ago
Alex Krolick
fec6d6c141
Add mutliple contexts example
7 years ago
Alex Krolick
b49f99b7d1
Highlight whole createContext() call
7 years ago