fix: svelte 5 prop types#14934
Conversation
🦋 Changeset detectedLatest commit: 217cdb0 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
florian-lefebvre
left a comment
There was a problem hiding this comment.
One last thing and we're good to go!
|
After updating from 7.2.2 to 7.2.3 of the svelte integration, I'm getting type errors on Svelte components whenever I add a client directive to them: ---
export const prerender = false
import BaseLayout from '@/layouts/Base.astro'
import ContactForm from '@/components/ContactForm.svelte'
---
<BaseLayout meta={{ title: 'Contact', description: 'Message me' }}>
<ContactForm client:load />
</BaseLayout> |
|
@Princesseuh what do you think? Should we try keep this approach and fix it, or revert? |
|
It's okay like this! |
|
@mikepayne02 can you open a new issue? Thank you |
It looks like it only happens when there are no props defined in the Svelte component. I’m working on a fix for this. |
|
Awesome thank you |
I'm not sure if this is the best way of solving this but it works when I tested it on vscode and with the cli 😅
Changes
Fixes the prop types for Svelte components inside Astro. Fixes #14681
Before
After
Testing
Added a new test to check the props type. I'm not sure if they are in the correct place.
Docs