@timber-js/app 0.1.31 → 0.1.32
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transition-root.d.ts","sourceRoot":"","sources":["../../src/client/transition-root.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAKL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAuBf;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,cAAc,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,SAAS,CAAA;CAAE,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"transition-root.d.ts","sourceRoot":"","sources":["../../src/client/transition-root.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAKL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAuBf;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,cAAc,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,SAAS,CAAA;CAAE,GAAG,SAAS,CAkC7E;AAID;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,SAAS,GAAG,IAAI,CAIzD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,OAAO,CAAC,SAAS,CAAC,GAChC,OAAO,CAAC,IAAI,CAAC,CAMf;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,OAAO,CAE/C"}
|
package/package.json
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
import {
|
|
28
28
|
useState,
|
|
29
29
|
useOptimistic,
|
|
30
|
-
|
|
30
|
+
useTransition,
|
|
31
31
|
createElement,
|
|
32
32
|
type ReactNode,
|
|
33
33
|
} from 'react';
|
|
@@ -73,6 +73,10 @@ let _navigateTransition: ((
|
|
|
73
73
|
export function TransitionRoot({ initial }: { initial: ReactNode }): ReactNode {
|
|
74
74
|
const [element, setElement] = useState<ReactNode>(initial);
|
|
75
75
|
const [optimisticPendingUrl, setOptimisticPendingUrl] = useOptimistic<string | null>(null);
|
|
76
|
+
// useTransition's startTransition (not the standalone import) creates an
|
|
77
|
+
// action context that useOptimistic can track. The standalone startTransition
|
|
78
|
+
// doesn't — optimistic values would never show.
|
|
79
|
+
const [, startTransition] = useTransition();
|
|
76
80
|
|
|
77
81
|
// Non-navigation render (revalidation, popstate cached replay).
|
|
78
82
|
_transitionRender = (newElement: ReactNode) => {
|