Last active
June 10, 2020 17:24
-
-
Save tadjohnston/15d42e8bb7eaa8277444adef51f0576b to your computer and use it in GitHub Desktop.
Revisions
-
tadjohnston revised this gist
Oct 9, 2019 . 1 changed file with 2 additions and 4 deletions.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 @@ -11,7 +11,7 @@ class Foo extends Component { list: '', } items = (list) => { const filteredList = list .filter(i => i !== null) .map(item => ({ bar: item.baz })) @@ -41,6 +41,4 @@ class Foo extends Component { </div> ) } } -
tadjohnston revised this gist
Jun 21, 2019 . 1 changed file with 3 additions and 3 deletions.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 @@ -12,9 +12,9 @@ class Foo extends Component { } items(list) { const filteredList = list .filter(i => i !== null) .map(item => ({ bar: item.baz })) return filteredList.map((item, index) => ( <Baz -
tadjohnston revised this gist
Jun 21, 2019 . 1 changed file with 2 additions and 2 deletions.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 @@ -32,11 +32,11 @@ class Foo extends Component { <div> {list && ( <div> {`Count is ${this.props.count} for items: `} {this.items(list)} </div> )} {!list && ( {`Count is ${this.props.count} for items: `} n/a )} </div> ) -
tadjohnston revised this gist
Jun 21, 2019 . 1 changed file with 4 additions and 4 deletions.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 @@ -1,8 +1,8 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' import Baz from 'baz' class Foo extends Component { static propTypes = { list: PropTypes.array, } @@ -31,9 +31,9 @@ class Foo extends PureComponent { return ( <div> {list && ( <div> {`Count is: ${this.props.count} for items: `} {this.items(list)} </div> )} {!list && ( {`Count is: ${this.props.count} for items: `} n/a -
tadjohnston revised this gist
Jun 21, 2019 . 1 changed file with 1 addition and 1 deletion.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 @@ -20,7 +20,7 @@ class Foo extends PureComponent { <Baz key={index} bar={item.bar} something={item.bar} /> )) } -
tadjohnston revised this gist
Jun 21, 2019 . 1 changed file with 10 additions and 3 deletions.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 @@ -1,8 +1,8 @@ import React, { PureComponent, Fragment } from 'react' import PropTypes from 'prop-types' import Baz from 'baz' class Foo extends PureComponent { static propTypes = { list: PropTypes.array, } @@ -30,7 +30,14 @@ class Foo extends React.PureComponent { return ( <div> {list && ( <Fragment> {`Count is: ${this.props.count} for items: `} {this.items(list)} </Fragment> )} {!list && ( {`Count is: ${this.props.count} for items: `} n/a )} </div> ) } -
tadjohnston revised this gist
Jun 21, 2019 . 1 changed file with 2 additions and 1 deletion.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 @@ -19,7 +19,8 @@ class Foo extends React.PureComponent { return filteredList.map((item, index) => ( <Baz key={index} bar={item.bar} bar={item.something} /> )) } -
tadjohnston renamed this gist
Jun 21, 2019 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
tadjohnston created this gist
Jun 21, 2019 .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,38 @@ import React from 'react' import PropTypes from 'prop-types' import Baz from 'baz' class Foo extends React.PureComponent { static propTypes = { list: PropTypes.array, } static defaultProps = { list: '', } items(list) { const filteredList = list.map(item => ({ bar: item.baz, })).filter(i => i !== null) return filteredList.map((item, index) => ( <Baz key={index} bar={item.bar} /> )) } render() { const { list } = this.props return ( <div> {`Count is: ${this.props.count} for items: `} {this.items(list)} </div> ) } } export default Foo