I have the following Skills component (attached as picture too, as unclear on how to format code here):
---import SectionTitle from "@components/SectionTitle.astro";import SkillItem from "@components/SkillItem.astro";import InfiniteLoopSlider from "@components/InfiniteLoopSlider.astro";import { shuffle, reverse } from "@src/utils.js"; import site from "@data/site"; // const SKILLS = pluck(site.skills, "name"); const SKILLS: string[] = [ "Wireframing", "User Testing", "Ideation", "User Flow", "Micro-Interactions", "Prototyping", "CSS & HTML", "Animation", "TailwindCSS", "Storybook", "Design Systems", "User-Centric Design", "Research", "Informational Architecture", "Strategy & Design", "Mobile App & Web Design", "Accessibility", "Usability Studies", "User Interface Development", "User Experience Design",]; const ROWS: number = 4;const SKILLS_PER_ROW: number = 6;--- <section class="pt-[26rem]"> <SectionTitle title="SKILLS" /> <div class="pt-40 relative flex flex-col shrink-0 gap-[1rem_0] max-w-[90vw] w-[40rem] p-[1.5rem_0] overflow-hidden" > { [...new Array(ROWS)].map((row, i) => { <InfiniteLoopSlider reverse={i % 2 === 0}> {shuffle(SKILLS) .slice(0, SKILLS_PER_ROW) .map((skill) => ( <SkillItem skill={skill} /> ))} </InfiniteLoopSlider>; }) } </div></section>
The issue i'm having is that when trying to render the SkillItem component, typescript shows an error of: Type 'unknown' is not assignable to type 'string' on <SkillItem skill={skill} />, which, as I understand, the mapping actually fails (skill is null/unknown).
Do I need to do this mapping on the frontmatter (if so, how would I do so?), or is there something obvious i'm missing here?
Thanks for any assistance!