Created
January 28, 2020 06:12
-
-
Save jelorivera08/f2c480c20fdabf7fadacda982c8f7ca8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// App.js | |
import React from 'react'; | |
import { graphql, QueryRenderer } from 'react-relay'; | |
import MainPage from './containers/MainPage'; | |
import environment from '../environment'; | |
export default class App extends React.Component { | |
render() { | |
return ( | |
<QueryRenderer | |
environment={environment} | |
query={graphql` | |
query AppQuery { | |
notes { | |
_id | |
content | |
} | |
} | |
`} | |
variables={{}} | |
render={({ error, props }) => { | |
if (error) { | |
return <div>Error!</div>; | |
} | |
if (!props) { | |
return <div>Loading...</div>; | |
} | |
return <MainPage {...props} />; | |
}} | |
/> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment