Skip to content

polakowski/react_recursion_exercise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Exercise - Recursion

This is a template app for React Exercise.

How to start the application

  • yarn install
  • yarn start

Instructions

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.

Bonus exercise

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published