Skip to content

Latest commit

 

History

History
9 lines (5 loc) · 539 Bytes

File metadata and controls

9 lines (5 loc) · 539 Bytes

3.2 Dynamically Render Components

Goal

  1. Implement a Foo component which simply renders <div>foo</div>, and a Bar component which simply renders <div>bar</div> (using render functions, obviously).

  2. Implement an <example> component which renders the Foo component or the Bar component based on its ok prop. For if ok is true, the final rendered dom should be <div>foo</div>.

  3. Implement a button in the root component that toggles <example> between Foo and Bar by controlling its ok prop.