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
Copy file name to clipboardExpand all lines: README.md
+8-10Lines changed: 8 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,7 @@
6
6
7
7
Asynchronous SSR-ready Document Head management for Solid based on [React Head](https://github.com/tizmagik/react-head)
8
8
9
+
> For Solid 1.8 use 0.29.x or greater.
9
10
> For Solid 1.0 use 0.27.x or greater.
10
11
> For versions of Solid 0.x use 0.26.x.
11
12
@@ -22,26 +23,23 @@ npm i @solidjs/meta
22
23
## How it works
23
24
24
25
1. You wrap your App with `<MetaProvider />`
25
-
1. From the server, you pass `tags[]` array to `<MetaProvider />`
26
-
1. Then call `renderTags(tags)` and include in the `<head />` block of your server template
27
-
1. To insert head tags within your app, just render one of `<Title />`, `<Meta />`, `<Style />`, `<Link />`, and `<Base />` components as often as needed.
26
+
2. To insert head tags within your app, just render one of `<Title />`, `<Meta />`, `<Style />`, `<Link />`, and `<Base />` components as often as needed.
27
+
3. One the server if you render the `<head>` element using SolidJS in JSX you are all good. Otherwise use `getAssets` from `solid-js/web` to insert the assets where you want.
28
28
29
-
On the server, the tags are collected in the `tags[]` array, and then on the client the server-generated tags are removed in favor of the client-rendered tags so that SPAs still work as expected (e.g. in cases where subsequent page loads need to change the head tags).
29
+
On the server, the tags are collected, and then on the client the server-generated tags are removed in favor of the client-rendered tags so that SPAs still work as expected (e.g. in cases where subsequent page loads need to change the head tags).
30
30
31
31
### Server setup
32
32
33
33
Wrap your app with `<MetaProvider />` on the server, using a `tags[]` array to pass down as part of your server-rendered payload. When rendered, the component mutates this array to contain the tags.
0 commit comments