From 417a7d0f2ada71aab0d04adf0635e24ed8e4906f Mon Sep 17 00:00:00 2001 From: Floris Bernard Date: Mon, 4 Feb 2019 17:04:18 +0100 Subject: [PATCH] Cast isInitializing to boolean The isInitializing prop can be of type function when the initAction has a clientOnly prop. --- package.json | 2 +- src/withInitAction.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 3fa2044..7485549 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-redux-component-init", - "version": "1.0.0", + "version": "1.0.1", "description": "A library to manage async cpmponent initialization in isomorphic React/Redux applications with server-side rendering", "main": "./lib/index.js", "scripts": { diff --git a/src/withInitAction.js b/src/withInitAction.js index fe6f63f..41a36bc 100644 --- a/src/withInitAction.js +++ b/src/withInitAction.js @@ -216,10 +216,10 @@ export default (p1, p2, p3) => { const { __componentInitState, __initComponent, __modeInitSelf, ...props } = this.props; const { selfInitState, isPrepared } = __componentInitState; - const isInitializing = __modeInitSelf + const isInitializing = !!(__modeInitSelf ? selfInitState === false || (typeof selfInitState === 'undefined' && !this.state.initializedOnce) - : (initAction && allowLazy && !isPrepared) || initActionClient; + : (initAction && allowLazy && !isPrepared) || initActionClient); const cloak = isInitializing &&