import apiFetch from '@wordpress/api-fetch'; import useSWRImmutable from 'swr/immutable'; const fetcher = (url: string) => apiFetch({ path: url }); export const useCanEditHTML = () => { const { data } = useSWRImmutable( '/code-block-pro/v1/can-save-html', fetcher, ); // Consider it true until the request completes return data; };