The value will not be persisted until there's a valid ID.
Queries will skip until there's a valid ID
Mutations and actions will await a promise for the first valid ID.
Breaking change for non-SSR (types only):
The type for useSessionId now is SessionId | undefined. The value will not be undefined except if ssrFriendly is used and it's the first render. It's safe to use sessionId! if you aren't setting ssrFriendly. After considering a different API for SSR, this seemed like the most composable option. h/t to @conradkoh for feedback
Changes behavior for SSR:
Breaking change for non-SSR (types only):
useSessionId
now isSessionId | undefined
. The value will not be undefined except ifssrFriendly
is used and it's the first render. It's safe to usesessionId!
if you aren't settingssrFriendly
. After considering a different API for SSR, this seemed like the most composable option. h/t to @conradkoh for feedback