Created
August 25, 2017 15:14
-
-
Save gc-codesnippets/24a1ada25a8a32ae581dc85abe8f6c2e to your computer and use it in GitHub Desktop.
This file contains 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
import environment from './createRelayEnvironment' | |
// ... | |
const root = <QueryRenderer | |
environment={environment} | |
query={graphql` | |
query appQuery { | |
viewer { | |
...TodoApp_viewer | |
} | |
} | |
`} | |
render={({error, props}) => { | |
if (props) { | |
return <TodoApp viewer={props.viewer} /> | |
} else { | |
return <div>Loading</div> | |
} | |
}} | |
/> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment