From 7b69719e22169e7e729a60f9cb56ee408df4e8f3 Mon Sep 17 00:00:00 2001 From: Sofiya Tepikin Date: Thu, 6 Feb 2020 00:17:25 +0100 Subject: [PATCH 1/2] Removes linter warning --- components/cycle-day/select-tab-group.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/components/cycle-day/select-tab-group.js b/components/cycle-day/select-tab-group.js index a761a24..63c0536 100644 --- a/components/cycle-day/select-tab-group.js +++ b/components/cycle-day/select-tab-group.js @@ -8,12 +8,13 @@ import AppText from '../app-text' export default class SelectTabGroup extends Component { render() { + const { buttons, onSelect } = this.props return ( { - this.props.buttons.map(({ label, value }, i) => { + buttons.map(({ label, value }, i) => { let firstOrLastStyle - if (i === this.props.buttons.length - 1) { + if (i === buttons.length - 1) { firstOrLastStyle = styles.selectTabLast } else if (i === 0) { firstOrLastStyle = styles.selectTabFirst @@ -23,7 +24,7 @@ export default class SelectTabGroup extends Component { if (isActive) activeStyle = styles.selectTabActive return ( isActive ? this.props.onSelect(null) : this.props.onSelect(value)} + onPress={() => onSelect(isActive ? null : value)} key={i} activeOpacity={1} > From 882f183c8ec0d675325012e12ea25a5af92ec3ff Mon Sep 17 00:00:00 2001 From: Sofiya Tepikin Date: Thu, 6 Feb 2020 00:17:00 +0100 Subject: [PATCH 2/2] Removes linter complaint about react version not being specified --- .eslintrc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.eslintrc b/.eslintrc index 028ba73..04a05da 100644 --- a/.eslintrc +++ b/.eslintrc @@ -19,6 +19,11 @@ "plugins": [ "react" ], + "settings": { + "react": { + "version": require('./package.json').dependencies.react, + }, + }, "rules": { "quotemark": false, "ordered-imports": false,