@tanstack/react-router 0.0.1-beta.167 → 0.0.1-beta.168

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tanstack/react-router",
3
3
  "author": "Tanner Linsley",
4
- "version": "0.0.1-beta.167",
4
+ "version": "0.0.1-beta.168",
5
5
  "license": "MIT",
6
6
  "repository": "tanstack/router",
7
7
  "homepage": "https://tanstack.com/router",
@@ -43,8 +43,8 @@
43
43
  "tiny-invariant": "^1.3.1",
44
44
  "tiny-warning": "^1.0.3",
45
45
  "@gisatcz/cross-package-react-context": "^0.2.0",
46
- "@tanstack/router-core": "0.0.1-beta.167",
47
- "@tanstack/react-store": "0.0.1-beta.167"
46
+ "@tanstack/router-core": "0.0.1-beta.168",
47
+ "@tanstack/react-store": "0.0.1-beta.168"
48
48
  },
49
49
  "scripts": {
50
50
  "build": "rollup --config rollup.config.js"
@@ -1,11 +1,11 @@
1
1
  import { DeferredPromise, isDehydratedDeferred } from '@tanstack/router-core'
2
- import { useRouter } from '.'
2
+ import { useRouter } from './react'
3
3
 
4
- export type DeferredOptions<T> = {
4
+ export type AwaitOptions<T> = {
5
5
  promise: DeferredPromise<T>
6
6
  }
7
7
 
8
- export function useDeferred<T>({ promise }: DeferredOptions<T>): [T] {
8
+ export function useAwaited<T>({ promise }: AwaitOptions<T>): [T] {
9
9
  const router = useRouter()
10
10
 
11
11
  let state = promise.__deferredState
@@ -30,11 +30,11 @@ export function useDeferred<T>({ promise }: DeferredOptions<T>): [T] {
30
30
  return [state.data]
31
31
  }
32
32
 
33
- export function Deferred<T>(
34
- props: DeferredOptions<T> & {
33
+ export function Await<T>(
34
+ props: AwaitOptions<T> & {
35
35
  children: (result: T) => JSX.Element
36
36
  },
37
37
  ) {
38
- const awaited = useDeferred(props)
38
+ const awaited = useAwaited(props)
39
39
  return props.children(...awaited)
40
40
  }