You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Optionally accepts a default value to be passed to Consumers without a Provider ancestor.
50
+
Optionally accepts a default value to be passed to Consumers without a Provider ancestor._Only Consumers that don't have a Provider higher in the tree receive the default value_.
51
51
52
52
### `Provider`
53
53
@@ -59,6 +59,10 @@ A React component that allows Consumers to subscribe to context changes.
59
59
60
60
Accepts a `value` prop to be passed to Consumers that are descendants of this Provider. One Provider can be connected to many Consumers. Providers can be nested to override values deeper within the tree.
61
61
62
+
> Note:
63
+
>
64
+
> If `value` is not provided, Consumers receive `undefined`. To use the default value in a Consumer instead, remove the Provider altogether.
0 commit comments