typing CreateResource
I would like to do something like this so typescript don't show an error when using it in jsx:
const [data, { mutate }] = createResource<{ dataExample: string } | undefined>(() =>
getData("/api/Example")
);
So i can do:
<p>{data()?.dataExample}</p>
const [data, { mutate }] = createResource<{ dataExample: string } | undefined>(() =>
getData("/api/Example")
);
So i can do:
<p>{data()?.dataExample}</p>
