From 13959877d32cdac550c41f62f84e4866f2dc8f47 Mon Sep 17 00:00:00 2001 From: rthurgood <44291173+rthurgood@users.noreply.github.com> Date: Wed, 21 Nov 2018 18:09:17 +0000 Subject: [PATCH] Update context.md (#1420) --- content/docs/context.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/docs/context.md b/content/docs/context.md index 81e2652f..35624cbc 100644 --- a/content/docs/context.md +++ b/content/docs/context.md @@ -115,7 +115,7 @@ However, sometimes the same data needs to be accessible by many components in th const MyContext = React.createContext(defaultValue); ``` -Creates an Context object. When React renders a component that subscribes to this Context object it will read the current context value from the closest matching `Provider` above it in the tree. +Creates a Context object. When React renders a component that subscribes to this Context object it will read the current context value from the closest matching `Provider` above it in the tree. The `defaultValue` argument is **only** used when a component does not have a matching Provider above it in the tree. This can be helpful for testing components in isolation without wrapping them. Note: passing `undefined` as a Provider value does not cause consuming components to use `defaultValue`.