How to use the react-relay-offline.useRestore function in react-relay-offline

To help you get started, we’ve selected a few react-relay-offline examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github morrys / offline-examples / relay / react-native / todo-updater / src / App.tsx View on Github external
const AppTodo = () => {
  const isRehydrated = useRestore(environment);
  if (!isRehydrated) {
    console.log("loading");
    return ;
  }
  console.log("renderer");
  return (
    
       {
github morrys / offline-examples / relay / todo-updater / js / app.js View on Github external
const AppTodo = props => {
  const isRehydrated = useRestore(environment);
  if (!isRehydrated) {
    console.log('loading');
    return <div>;
  }
  console.log('renderer');
  // ***** added to verify useRestore and fetchQuery ***
  /*const [load, setLoad] = React.useState(false);

  React.useEffect(() =&gt; {
    Array.from({length: 10},(_,x) =&gt;
    fetchQuery(environment, graphql`
    query appQuery($userId: String) {
      user(id: $userId) {
        ...TodoApp_user
      }
    }</div>