You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Finally, a riskier approach involves using the definite assignment assertion right at the point of variable initialization.
@@ -513,7 +511,7 @@ let divRef!: HTMLDivElement;
513
511
// Permitted by TypeScript but will throw an error at runtime:
514
512
// divRef.focus();
515
513
516
-
onMount(() => {
514
+
onSettled(() => {
517
515
divRef.focus();
518
516
});
519
517
```
@@ -737,6 +735,10 @@ declare module "solid-js" {
737
735
738
736
#### Custom directives
739
737
738
+
:::caution[Solid 2.0 — `use:` directives are removed]
739
+
In Solid 2.0, `use:` directives are removed. Directives are now expressed as `ref` callbacks/factories. See [Refs](/concepts/refs#directives-via-ref-factories) for the 2.0 pattern. The TypeScript patterns below apply to Solid 1.x and the `@solidjs/legacy` compatibility layer.
740
+
:::
741
+
740
742
In Solid, custom directives can be applied using the `use:___` attribute, which usually accepts a target element and a JSX attribute value.
741
743
The traditional `Directives` interface types these values directly (i.e. the type of `value` in `<div use:foo={value} />`).
742
744
However, the newer `DirectiveFunctions` interface takes a function type and derives the valid types for elements and values from it.
Copy file name to clipboardExpand all lines: src/routes/reference/rendering/render-to-stream.mdx
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ function renderToStream<T>(
34
34
```
35
35
36
36
This method renders to a stream.
37
-
It renders the content synchronously including any Suspense fallback placeholders, and then continues to stream the data and HTML from any async resource as it completes.
37
+
It renders the content synchronously including any Loading fallback placeholders, and then continues to stream the data and HTML from any async resource as it completes.
0 commit comments