From ba8d899d5d8ac19a9942641dedc5b67e460231fd Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Wed, 16 Oct 2019 23:58:51 +0300 Subject: [PATCH] Fix eslint warnings. --- src/components/ContactEdit.tsx | 8 ++++++-- src/components/EventEdit.tsx | 8 ++++++-- src/components/TaskEdit.tsx | 8 ++++++-- src/widgets/ExternalLink.tsx | 6 ++++-- 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/components/ContactEdit.tsx b/src/components/ContactEdit.tsx index e0309b3..8ac8545 100644 --- a/src/components/ContactEdit.tsx +++ b/src/components/ContactEdit.tsx @@ -205,9 +205,13 @@ class ContactEdit extends React.PureComponent { if ((this.props.collections !== nextProps.collections) || (this.props.initialCollection !== nextProps.initialCollection)) { if (nextProps.initialCollection) { - this.state.journalUid = nextProps.initialCollection; + this.setState({ + journalUid: nextProps.initialCollection, + }); } else if (nextProps.collections[0]) { - this.state.journalUid = nextProps.collections[0].uid; + this.setState({ + journalUid: nextProps.collections[0].uid, + }); } } } diff --git a/src/components/EventEdit.tsx b/src/components/EventEdit.tsx index 97f1d25..513fcf9 100644 --- a/src/components/EventEdit.tsx +++ b/src/components/EventEdit.tsx @@ -118,9 +118,13 @@ class EventEdit extends React.PureComponent { if ((this.props.collections !== nextProps.collections) || (this.props.initialCollection !== nextProps.initialCollection)) { if (nextProps.initialCollection) { - this.state.journalUid = nextProps.initialCollection; + this.setState({ + journalUid: nextProps.initialCollection, + }); } else if (nextProps.collections[0]) { - this.state.journalUid = nextProps.collections[0].uid; + this.setState({ + journalUid: nextProps.collections[0].uid, + }); } } } diff --git a/src/components/TaskEdit.tsx b/src/components/TaskEdit.tsx index 31340c5..b20ea96 100644 --- a/src/components/TaskEdit.tsx +++ b/src/components/TaskEdit.tsx @@ -106,9 +106,13 @@ class TaskEdit extends React.PureComponent { if ((this.props.collections !== nextProps.collections) || (this.props.initialCollection !== nextProps.initialCollection)) { if (nextProps.initialCollection) { - this.state.journalUid = nextProps.initialCollection; + this.setState({ + journalUid: nextProps.initialCollection, + }); } else if (nextProps.collections[0]) { - this.state.journalUid = nextProps.collections[0].uid; + this.setState({ + journalUid: nextProps.collections[0].uid, + }); } } } diff --git a/src/widgets/ExternalLink.tsx b/src/widgets/ExternalLink.tsx index f8360b7..046adaa 100644 --- a/src/widgets/ExternalLink.tsx +++ b/src/widgets/ExternalLink.tsx @@ -1,8 +1,10 @@ import * as React from 'react'; import { pure } from 'recompose'; -export const ExternalLink = pure((props: any) => ( - +export const ExternalLink = pure(({children, ...props}: any) => ( + + {children} + )); export default ExternalLink;