Skip to content

Commit e98dc71

Browse files
Sync svelte docs (#1294)
sync svelte docs Co-authored-by: svelte-docs-bot[bot] <196124396+svelte-docs-bot[bot]@users.noreply.github.com>
1 parent 390c3fe commit e98dc71

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

apps/svelte.dev/content/docs/svelte/98-reference/.generated/compile-warnings.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -823,15 +823,16 @@ See [the migration guide](v5-migration-guide#Snippets-instead-of-slots) for more
823823
### state_referenced_locally
824824

825825
```
826-
State referenced in its own scope will never update. Did you mean to reference it inside a closure?
826+
This reference only captures the initial value of `%name%`. Did you mean to reference it inside a %type% instead?
827827
```
828828

829829
This warning is thrown when the compiler detects the following:
830+
830831
- A reactive variable is declared
831-
- the variable is reassigned
832-
- the variable is referenced inside the same scope it is declared and it is a non-reactive context
832+
- ...and later reassigned...
833+
- ...and referenced in the same scope
833834

834-
In this case, the state reassignment will not be noticed by whatever you passed it to. For example, if you pass the state to a function, that function will not notice the updates:
835+
This 'breaks the link' to the original state declaration. For example, if you pass the state to a function, the function loses access to the state once it is reassigned:
835836

836837
```svelte
837838
<!--- file: Parent.svelte --->

apps/svelte.dev/content/docs/svelte/98-reference/21-svelte-compiler.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,6 +1035,8 @@ css: null | {
10351035
code: string;
10361036
/** A source map */
10371037
map: SourceMap;
1038+
/** Whether or not the CSS includes global rules */
1039+
hasGlobal: boolean;
10381040
};
10391041
```
10401042

apps/svelte.dev/content/docs/svelte/98-reference/30-compiler-warnings.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -844,15 +844,16 @@ See [the migration guide](v5-migration-guide#Snippets-instead-of-slots) for more
844844
### state_referenced_locally
845845

846846
```
847-
State referenced in its own scope will never update. Did you mean to reference it inside a closure?
847+
This reference only captures the initial value of `%name%`. Did you mean to reference it inside a %type% instead?
848848
```
849849

850850
This warning is thrown when the compiler detects the following:
851+
851852
- A reactive variable is declared
852-
- the variable is reassigned
853-
- the variable is referenced inside the same scope it is declared and it is a non-reactive context
853+
- ...and later reassigned...
854+
- ...and referenced in the same scope
854855

855-
In this case, the state reassignment will not be noticed by whatever you passed it to. For example, if you pass the state to a function, that function will not notice the updates:
856+
This 'breaks the link' to the original state declaration. For example, if you pass the state to a function, the function loses access to the state once it is reassigned:
856857

857858
```svelte
858859
<!--- file: Parent.svelte --->

0 commit comments

Comments
 (0)