prefetch() within getServerSideProps does not provide data upon manual refreshing
Within getServerSideProps:
await ssh.user.getDepositInfo.prefetch(userId);
await ssh.user.getFQOperationHistory.prefetch(userId);
return { props: { trpcState: ssh.dehydrate(), } };
When I'm trying to use useContext() queries in a component, initially data is flowing, but when I force refresh ( command + R ), data is undefined at first, then populated.
const utils = api.useContext();
const data = utils.user.getDepositInfo.getData(user?.id); //undefined
const list = utils.user.getFQOperationHistory.getData(user?.id); //undefined
Is there something I'm doing wrong? How do I get around it?0 Replies