Fragment so small so significant
Solidify your knowledge of JSX by solving this problem.
Dogesh has a website build with React where he is facing the trouble of having too many div
tags just to group together components. He has heard about this new shinny concept called Fragments. Can you help him implement the same.
Tip: Checkout Fragments: https://reactjs.org/docs/fragments.html
In DOM it should look like this:
<h1>My Cool Bio</h1> <p>I live on the edge. I sit on the ledge. I click cool pics. I post them with Swag!</p>
Requirements:
-
There should be a heading (1st Node)
- With text:
My Cool Bio
(case insensitive) - It should be the first Node of the DOM
- With text:
-
There should be a paragraph (2nd Node)
- With text:
I live on the edge. I sit on the ledge. I click cool pics. I post them with Swag!
(case insensitive) - It should be the second Node of the DOM
- With text:
Solve this medium problem to earn 2