Created
February 17, 2022 12:36
-
-
Save iamparthaonline/46c4f7666b565721aba1227ae746e952 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from "react"; | |
| const ParagraphSpans = function (spans) { | |
| return ( | |
| <React.Fragment> | |
| {spans.map((spanLabel) => ( | |
| <span>{spanLabel}</span> | |
| ))} | |
| </React.Fragment> | |
| ); | |
| }; | |
| const FunctionalContentComponent = function (props) { | |
| return ( | |
| <body> | |
| {props.list.map(({ title, paragraph }, index) => ( | |
| <React.Fragment key={index}> | |
| <h1>{title} </h1> | |
| <p> | |
| <ParagraphSpans spans={paragraph} /> | |
| </p> | |
| </React.Fragment> | |
| ))} | |
| </body> | |
| ); | |
| }; | |
| export default FunctionalContentComponent; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment