@unhead/react 2.1.5 → 2.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +6 -0
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -24,6 +24,9 @@ function withSideEffects(input, options, fn) {
|
|
|
24
24
|
const entryRef = useRef(null);
|
|
25
25
|
const inputRef = useRef(input);
|
|
26
26
|
inputRef.current = input;
|
|
27
|
+
if (unhead.ssr && !entryRef.current) {
|
|
28
|
+
entryRef.current = fn(unhead, input, options);
|
|
29
|
+
}
|
|
27
30
|
useEffect(() => {
|
|
28
31
|
const entry = fn(unhead, inputRef.current, options);
|
|
29
32
|
entryRef.current = entry;
|
|
@@ -35,6 +38,9 @@ function withSideEffects(input, options, fn) {
|
|
|
35
38
|
useEffect(() => {
|
|
36
39
|
entryRef.current?.patch(input);
|
|
37
40
|
}, [input]);
|
|
41
|
+
if (unhead.ssr) {
|
|
42
|
+
return entryRef.current;
|
|
43
|
+
}
|
|
38
44
|
const proxyRef = useRef(null);
|
|
39
45
|
if (!proxyRef.current) {
|
|
40
46
|
proxyRef.current = {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unhead/react",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.1.
|
|
4
|
+
"version": "2.1.6",
|
|
5
5
|
"description": "Full-stack <head> manager built for React.",
|
|
6
6
|
"author": "Harlan Wilton <harlan@harlanzw.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
]
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|
|
73
|
-
"unhead": "2.1.
|
|
73
|
+
"unhead": "2.1.6"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@testing-library/react": "^16.3.1",
|