mirror of https://github.com/sveltejs/svelte
parent
d856c50092
commit
9084f1796b
@ -0,0 +1,5 @@
|
||||
---
|
||||
"svelte": patch
|
||||
---
|
||||
|
||||
fix: allow runelike writable as prop
|
@ -0,0 +1,18 @@
|
||||
import { flushSync } from 'svelte';
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
test({ assert, target, ok }) {
|
||||
const button = target.querySelector('button');
|
||||
|
||||
flushSync(() => {
|
||||
button?.click();
|
||||
});
|
||||
assert.htmlEqual(
|
||||
target.innerHTML,
|
||||
`
|
||||
<button>1</button>
|
||||
`
|
||||
);
|
||||
}
|
||||
});
|
@ -0,0 +1,5 @@
|
||||
<script>
|
||||
let { state } = $props();
|
||||
</script>
|
||||
|
||||
<button onclick={()=> $state++}>{$state}</button>
|
@ -0,0 +1,8 @@
|
||||
<svelte:options runes />
|
||||
<script>
|
||||
import { writable } from "svelte/store";
|
||||
import Child from "./child.svelte";
|
||||
const state = writable(0);
|
||||
</script>
|
||||
|
||||
<Child {state} />
|
@ -0,0 +1,6 @@
|
||||
<script>
|
||||
let { state } = $props();
|
||||
let x = $state();
|
||||
</script>
|
||||
|
||||
{$state}
|
@ -0,0 +1,14 @@
|
||||
[
|
||||
{
|
||||
"code": "store_rune_conflict",
|
||||
"message": "It looks like you're using the `$state` rune, but there is a local binding called `state`. Referencing a local variable with a `$` prefix will create a store subscription. Please rename `state` to avoid the ambiguity",
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 15
|
||||
}
|
||||
}
|
||||
]
|
Loading…
Reference in new issue