Last active
September 23, 2018 03:41
-
-
Save cserrano3/3a8eed88e65cdf2098c3697a346ae960 to your computer and use it in GitHub Desktop.
Revisions
-
cserrano3 revised this gist
Sep 23, 2018 . No changes.There are no files selected for viewing
-
cserrano3 created this gist
Sep 23, 2018 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ const App = () => { <List render={ ({items}) => ( <ul> {items.map(item => { <li key={item.id}>{item.name}</li> })} </ul> ) } /> }; 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ export default class List extends React.Component { constructor(props) { super(props); this.state = { items: [] }; } componentDidMount() { this.setState({items: source.getItems()}); } render() { return this.props.render(this.state); } }