I'm having trouble understanding the meaning of this error. I've created a Type for an array of items where each item is a string
.
Interestingly, when I enclose the listItem
within an empty fragment, the error disappears. Is there something I'm overlooking? Each item should be a string only within an array of items.
export type Item = {
listItem: string;
};
import { motion } from 'framer-motion';
import { Item } from '@typings/propTypes';
import { container, item } from '@lib/framer';
const UnorderedList = ({
listItems,
htmlClass
}: {
htmlClass: string;
listItems: Item[];
}) => (
<motion.ul
variants={container}
initial="hidden"
animate="show"
className={`flex flex-col flex-wrap my-6 leading-relaxed ${
htmlClass ? htmlClass : 'text-white'
}`}
>
{listItems.map((listItem, index) => (
<motion.li key={index} variants={item} className="flex gap-3">
{listItem}
</motion.li>
))}
</motion.ul>
);
export default UnorderedList;