I have been trying to put some animation on a title.. (using ReactJs)
The issue I have is that my Array.map() won't display my spaces from my string:
Prop 'title' = "Header Right Here!!"
const TitleAnimation = ({title}) => {
const titleArray = title.split("");
console.log(titleArray);
// logs all characters in an array, including spaces
return (
<Wrapper className="text-6xl">
{titleArray.map((character, index) => {
return (
<span key={index}>{character}</span>
)
})}
</Wrapper>
);
}
Instead of having multiple spans returning "Header Right Here", it returns "HeaderRightHere"
Did I do something wrong?
Thanks in advance!