Open nicholaschiang opened 2 years ago
This is what I'm using right now:
export function useMatches(): ReturnType<typeof useRemixMatches> {
const matches = useRemixMatches();
return matches.map(({ data, ...rest }) => ({
...rest,
data: data ? parse(data as SuperJSONResult) : data,
}));
}
Similarly this is necessary on the Remix Handle function
export const handle = withSuperJson((matches: MatchesProps) => '');
Similarly to
useLoaderData
, I'm guessing you'll also have to wrapuseMatches
with Blitz.js'ssuperjson
package.