Replacement of $$props.class in svelte 5 #11080
-
I was trying svelte 5 preview and I am wondering how can I access the class prop passed to a component. I tried this but it is giving me some typescript errors |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Beta Was this translation helpful? Give feedback.
-
Thanks @Conduitry |
Beta Was this translation helpful? Give feedback.
let { class } = $props()
is invalid javascript (and typescript). You can uselet { class: className } = $props()
or any other name you want that's a valid JS identifier name.