Created
September 2, 2016 17:55
-
-
Save Killavus/094a0e63709575c0be8325677430f458 to your computer and use it in GitHub Desktop.
An example of orchestrating the service.
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
// In your initialize code: | |
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import FetchData from './fetch-data'; // Your data-fetching service. | |
import Component from './component'; | |
ReactDOM.render(<Component {...props} />, domElement, | |
function loadData() { | |
// this points to your component instance here. | |
FetchData().then(data => { | |
this.setState({ data }); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment