From 2a2cb24fa67cb3f909aa19a290411e2b339b3997 Mon Sep 17 00:00:00 2001 From: Noriaki Uchiyama Date: Thu, 7 Jul 2016 17:59:27 +0900 Subject: [PATCH] allow React.Component type argument if pass multi connected components to renderReactRedux(), required to wrap a element. because react-redux Provider should enforce a single child. (e.g.) renderReactRedux( 'MyComponent.js',
, configureStore ); --- src/index.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/index.jsx b/src/index.jsx index 5c5f67c..bb35c57 100644 --- a/src/index.jsx +++ b/src/index.jsx @@ -7,7 +7,11 @@ import hypernova, { serialize, load } from 'hypernova'; function buildProvider(connectedComponent, store) { return ( - {React.createElement(connectedComponent)} + { + React.isValidElement(connectedComponent) + ? connectedComponent + : React.createElement(connectedComponent) + } ); }