mirror of https://github.com/sveltejs/svelte
fix: migrating rest props type includes props types (#13632)
* fix: rest props type includes props types * chore: remove extra line * Update .changeset/spotty-kings-hug.mdpull/13651/head
parent
d7cf76bbb6
commit
b352f08e9d
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: migrating rest props type includes props types
|
@ -0,0 +1,5 @@
|
||||
<script lang="ts">
|
||||
export let foo: string;
|
||||
</script>
|
||||
|
||||
<button {foo} {...$$restProps}>click me</button>
|
@ -0,0 +1,10 @@
|
||||
<script lang="ts">
|
||||
interface Props {
|
||||
foo: string;
|
||||
[key: string]: any
|
||||
}
|
||||
|
||||
let { foo, ...rest }: Props = $props();
|
||||
</script>
|
||||
|
||||
<button {foo} {...rest}>click me</button>
|
@ -1,5 +1,5 @@
|
||||
<script>
|
||||
/** @type {Record<string, any>} */
|
||||
/** @type {{foo: any, [key: string]: any}} */
|
||||
let { foo, ...rest } = $props();
|
||||
</script>
|
||||
|
||||
|
Loading…
Reference in new issue