SolidJSS
SolidJS17mo ago
jack

typing Page props ?

is it possible to type the props for the page? I'm tryna to block the page until render, and the best I've come up with is:
const load = cache(
  (userId: string) => api.getSelectionsByUserId(userId),
  "selections"
);

export const route = {
  preload: () => load,
} satisfies RouteDefinition;

export default function Username(props: ManuallyTypePropsAfterLookingAtConsoleLog) {
  const selections = createAsync(() => load(users[0].id), {
    deferStream: true,
    initialValue: props.data,
  });
//...


but the props have to be manually typed
Was this page helpful?