Rest Hooks legacy support.
shapeToEndpoint
import { shapeToEndpoint } from '@rest-hooks/legacy';
function MyComponent() {
const endpoint: any = useMemo(() => {
return shapeToEndpoint(fetchShape);
// we currently don't support shape changes
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
const mydata = useSuspense(endpoint, params);
//...
}