Skip to content Skip to sidebar Skip to footer

Relay: Cannot Read Property 'fetchkey' Of Null

Im trying to use the new relay hooks but getting this error: import React, { Fragment, Suspense, useEffect } from 'react'; import Banner from './banner/Banner.react'; const { grap

Solution 1:

You need to check if queryReference is not null, so you don't call usePreloadedQuery with a null value in your Home component. Try with:

return (
  <Suspense fallback="Loading...">
    <Fragment>
      {queryReference != null && <Home queryReference={queryReference} />}
    </Fragment>
  </Suspense>
);

Post a Comment for "Relay: Cannot Read Property 'fetchkey' Of Null"