* fix: restructure certifications guide articles * fix: added 3 dashes line before prob expl * fix: added 3 dashes line before hints * fix: added 3 dashes line before solutions
876 B
876 B
title
title |
---|
Use React to Render Nested Components |
Use React to Render Nested Components
Problem Explanation
You have learned in earlier lessons, that there are two ways to create a React component:
-
Stateless functional component - using a JavaScript function.
-
Define a React component using the ES6 syntax.
Hints
Hint 1
In this challenge, we have defined two stateless functional components, i.e. using JavaScript functions. Recall, once a component has been created, it can be rendered in the same way as an HTML tag, by using the component name inside HTML opening and closing brackets. For example, to nest a component called Dog inside a parent component called Animals, you'd simply return the Dog component from the Animals component like this:
return <Dog />;
Try this with the TypesOfFruit and Fruits components.