Dan Abramov 3 years ago
parent
commit
31304b8057
  1. 2
      beta/src/pages/apis/usecontext.md

2
beta/src/pages/apis/usecontext.md

@ -175,8 +175,6 @@ Now any `Button` inside of the provider will receive the current `theme` value.
<Recipes titleText="Examples of updating context" titleId="examples-basic"> <Recipes titleText="Examples of updating context" titleId="examples-basic">
---
### Updating a value via context {/*updating-a-value-via-context*/} ### Updating a value via context {/*updating-a-value-via-context*/}
In this example, the `MyApp` component holds a state variable which is then passed to the `ThemeContext` provider. Checking the "Dark mode" checkbox updates the state. Changing the provided value re-renders all the components using that context. In this example, the `MyApp` component holds a state variable which is then passed to the `ThemeContext` provider. Checking the "Dark mode" checkbox updates the state. Changing the provided value re-renders all the components using that context.

Loading…
Cancel
Save