Skip to content

Instantly share code, notes, and snippets.

@oneybee
Created March 25, 2018 09:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oneybee/381f1960a68d881a11426c44a792f84e to your computer and use it in GitHub Desktop.
Save oneybee/381f1960a68d881a11426c44a792f84e to your computer and use it in GitHub Desktop.
api setting
import React, {Component} from 'react';
import Interactive from 'react-interactive';
import { Switch, Route, Link } from 'react-router-dom';
import ExampleTwoDeepComponent from './ExampleTwoDeepComponent';
import PageNotFound from './PageNotFound';
import s from '../styles/exampleComponent.style';
class exampleComponent extends Component {
constructor() {
super()
this.state = {
data: [],
}
}
componentDidMount() {
return fetch(' ')
.then((response) => response.json())
.then((responseJson) => {
this.setState({
data:responseJson
})
console.log(this.state.data)
})
}
render() {
return (
<div>
{
this.state.data.map( (dynamicData,key)=>
<div key={key}>
{console.log('dynamicData', dynamicData)}
</div>
)
}
</div>
)
}
}
export default exampleComponent;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment