From 97eaa756fed6e33a0d849347911ac92cea171232 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Fri, 15 Dec 2017 12:52:20 +0000 Subject: [PATCH] Add FIXMEs for the withRouter workaround Because of: https://github.com/ReactTraining/react-router/issues/5795 We have to use withRouter which triggers a lot of extra renderings. This means that until the bug is fixed we have to use withRouter and some memoization to make sure we don't recalc everything all the time. --- src/Root.tsx | 1 + src/SyncGate.tsx | 1 + 2 files changed, 2 insertions(+) diff --git a/src/Root.tsx b/src/Root.tsx index 3040be4..85808d0 100644 --- a/src/Root.tsx +++ b/src/Root.tsx @@ -66,6 +66,7 @@ const mapStateToProps = (state: StoreState) => { }; }; +// FIXME: withRouter is only needed here because of https://github.com/ReactTraining/react-router/issues/5795 export default withRouter(connect( mapStateToProps )(Root)); diff --git a/src/SyncGate.tsx b/src/SyncGate.tsx index 4dc9d0b..e332646 100644 --- a/src/SyncGate.tsx +++ b/src/SyncGate.tsx @@ -145,6 +145,7 @@ const mapStateToProps = (state: StoreState, props: PropsType) => { }; }; +// FIXME: withRouter is only needed here because of https://github.com/ReactTraining/react-router/issues/5795 export default withRouter(connect( mapStateToProps )(SyncGate));