Skip to content

Instantly share code, notes, and snippets.

@iamparthaonline
Created February 17, 2022 12:36
Show Gist options
  • Select an option

  • Save iamparthaonline/46c4f7666b565721aba1227ae746e952 to your computer and use it in GitHub Desktop.

Select an option

Save iamparthaonline/46c4f7666b565721aba1227ae746e952 to your computer and use it in GitHub Desktop.
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