Providing a Context from a component can make it tricky to test, because it requires that you use a matching Consumer in your tests. In this lesson you’ll learn how to test a component that uses a Context Provider.
Note: The 'before' code for this lesson is the code from the previous lesson.
Dave, are there any docs that cover which types and values that React will treat as empty? In the lesson you mentioned that true
, false
, null
and undefined
would be treated as empty when evaluated in JSX.
<span>{ false /* or any of the other values mentioned */ }</span> // => <span></span>