Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unexpected behavior of useSessionStorageState when using SSR #859

Closed
tmkx opened this issue Feb 4, 2021 · 0 comments
Closed

unexpected behavior of useSessionStorageState when using SSR #859

tmkx opened this issue Feb 4, 2021 · 0 comments

Comments

@tmkx
Copy link
Contributor

tmkx commented Feb 4, 2021

Client Render:

function useStorageState<T>(
key: string,
defaultValue?: T | IFuncUpdater<T>,
): StorageStateResult<T> {

Server Render:

return function (defaultValue: any) {

unmatched parameters lead to

const [userInfo, setUserInfo] = useSessionStorageState<User>(`USER_INFO`, null);

return null in client BUT return "USER_INFO" in server ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants