mirror of https://github.com/sveltejs/svelte
fix: exclude local declarations from non-reactive property warnings (#12909)
* fix: exclude local declarations from non-reactive property warnings * copypasta failpull/12907/head
parent
0da4116b9d
commit
78b55c4130
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: exclude local declarations from non-reactive property warnings
|
@ -0,0 +1,3 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({});
|
@ -0,0 +1,8 @@
|
||||
<script>
|
||||
import { obj } from './data.js';
|
||||
|
||||
$: prop = obj.prop;
|
||||
obj.foo = 'a different prop';
|
||||
</script>
|
||||
|
||||
<p>{prop}</p>
|
@ -0,0 +1,14 @@
|
||||
[
|
||||
{
|
||||
"code": "reactive_declaration_non_reactive_property",
|
||||
"message": "Properties of objects and arrays are not reactive unless in runes mode. Changes to this property will not cause the reactive statement to update",
|
||||
"start": {
|
||||
"line": 4,
|
||||
"column": 11
|
||||
},
|
||||
"end": {
|
||||
"line": 4,
|
||||
"column": 19
|
||||
}
|
||||
}
|
||||
]
|
@ -0,0 +1,3 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({});
|
@ -0,0 +1,9 @@
|
||||
<script>
|
||||
let prop;
|
||||
$: {
|
||||
const obj = get_obj();
|
||||
prop = obj.prop;
|
||||
}
|
||||
</script>
|
||||
|
||||
<p>{prop}</p>
|
Loading…
Reference in new issue