Change top level requirement wording (#7336)

Changed the wording to be more consistent between `<svelte:window>`, `<svelte:body>` and `<svelte:head>`.
Chose "may only appear" over "has to appear" as the latter could be misinterpreted as a compulsory element
pull/7286/head
TzuHsuan 2 years ago committed by GitHub
parent 42905c757f
commit 535a1fc20d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1683,7 +1683,7 @@ All except `scrollX` and `scrollY` are readonly.
Similarly to `<svelte:window>`, this element allows you to add listeners to events on `document.body`, such as `mouseenter` and `mouseleave`, which don't fire on `window`. It also lets you use [actions](/docs#template-syntax-element-directives-use-action) on the `<body>` element.
`<svelte:body>` also has to appear at the top level of your component.
As with `<svelte:window>`, this element may only appear the top level of your component and must never be inside a block or element.
```sv
<svelte:body
@ -1704,7 +1704,7 @@ Similarly to `<svelte:window>`, this element allows you to add listeners to even
This element makes it possible to insert elements into `document.head`. During server-side rendering, `head` content is exposed separately to the main `html` content.
As with `<svelte:window>` and `<svelte:body>`, this element has to appear at the top level of your component and cannot be inside a block or other element.
As with `<svelte:window>` and `<svelte:body>`, this element may only appear at the top level of your component and must never be inside a block or element.
```sv
<svelte:head>

Loading…
Cancel
Save