opendevs
opendevs logo
CoursesInterviewsBlogs

Fragment so small so significant

Solidify your knowledge of JSX by solving this problem.
Living in style with class

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:

  1. There should be a heading (1st Node)

    1. With text: My Cool Bio (case insensitive)
    2. It should be the first Node of the DOM
  2. There should be a paragraph (2nd Node)

    1. With text: I live on the edge. I sit on the ledge. I click cool pics. I post them with Swag! (case insensitive)
    2. It should be the second Node of the DOM

Solve this medium problem to earn  2  DevCoin image
Output
Coding Area
opendevs logo
CoursesFAQsContact UsPrivacy PolicyTerms Of Service
Copyright © 2023 opendevs
Learn ● Develop ● Ace
All illustrations by Storyset