index.astro:
<Secondary
client:load
props={{
text: "My Work",
handleClick: () => {
window.location.href = "/projects";
},
size: "lg",
align: "center",
padded: false,
}}
/>
All of these props are being passed as expected, however when I log the handleClick prop in the Secondary component directly, it returns as null.
Weirdly enough, this same component works when nested inside of Card.svelte, another svelte component which is rendered in index.astro:
<SkillCard
props={{
title: "Svelte",
description: "Svelte is cool",
icon: {
name: "blue-svelte-icon",
type: "custom",
href: "https://svelte.dev/",
},
endpoint: "/projects?skill=svelte",
border: {
color: "#3d6eff",
caption: "Most Experience",
},
}}
client:load
/>
^^^ this component renders the Secondary svelte component as a child, in which case its props work as expected.