This is a template app for React Exercise.
yarn install
yarn start
Write a React component, that receives array of React Component classes (e.g. "One", "Two", "Three") as prop, then recursively renders HTML with those components:
<One>
<Two>
<Three>
</Three>
</Two>
</One>
Let the produced html be as followed:
<div class='App-box'>
One
<div class='App-box'>
Two
<div class='App-box'>
Three
</div>
</div>
</div>
Files that should be edited:
- src/recursion/Recursion.js
- src/recursion/RecursiveComponent.js
Do not edit any other files.
Modify your One
, Two
and Three
components, so they don't re-render on every timer tick. RecursiveComponent
can re-render, but each component in recursive function shouldn't.