I have made a split of the Text. Now I want to split it further into a single letter/character. Further I want to extent the splitting process to a set of array which is inside the content.
Below is my react code:
import React from "react";
import "./styles.css";
import content from "./content";
// Splitting Texts
const SplitText = React.memo(({ str }) => {
return (
<div>
{str.split(" ").map((item, index) => {
return <div key={index}>{item}</div>;
})}
</div>
);
});
// Main App
export default function App() {
return (
<div className="App">
<h1>
<SplitText str={"Lucie Bachman"} />
</h1>
<h2>
<SplitText str={"Hey, this is my first post on StackOverflow!"} />
</h2>
</div>
);
}