Commit graph

7 commits

Author SHA1 Message Date
jmgr2996
dd264f582f
chore: Remove redundant imports in several examples (#13030) 2020-05-18 13:02:23 -04:00
Martin Twum Mensah
b95228ed89 chore: fix typo of Unkown to Unknown (#9809) 2019-12-22 12:07:33 +01:00
Henrik Wenz
fd0ba93faa Refactor with-context-api example to use functional components (#9092) 2019-10-18 02:00:23 -04:00
Henrik Wenz
aa406a1d62 Fix with-context-api example (#8559)
## Motivation

The code before this PR had serveral issues:

1. Context uses reference identity to determine when to re-render, there are some gotchas that could trigger unintentional renders in consumers when a provider’s parent re-renders.

https://reactjs.org/docs/context.html#caveats

2. `setState` should use the reducer pattern in this example to make sure clicks are not swallowed by react batch.
2019-08-29 12:09:22 -04:00
Corbin Crutchley
e03266008c form handler example: Update deps and fix build from dep update (#6732)
* form handler example: Update deps and fix build from dep update

* Ran lint error fixers

* Fixes errors that occur when commit occurs

* Commit linter fixes
2019-03-27 16:12:45 -04:00
Peter Kellner
53f2d88566 Updated with-context-api to include an about page and also events that pass data to context provider (#6082)
…aces (home and about pages). This makes it the example more clear and why someone might want to use _app.js in the first place.  Also, added a button on the about page that allows for passing and arbitrary value from the about page to the context provider. I disagree with the naming convention of calling the class CounterProvider. It includes both a Provider and Consumer so it should have some name that covers both.  Maybe it should be called CounterContext but I did not change that. I've seen other examples of the same naming conversion so figure I'm the odd duck here (still think it's wrong no matter how many people do it).
2019-01-17 22:13:34 +01:00
maurodaprotis
1f64082c03 Add with-context-api example (#5154)
* Add with-context-api example

* Change next dependency to canary and fix CounterProvider import
2018-09-14 12:04:29 +02:00