From 9c92af80b69094082b6ba3b0614d2e697f89d31e Mon Sep 17 00:00:00 2001 From: Max Jung Date: Thu, 8 Feb 2018 12:46:38 +0900 Subject: [PATCH] Add the support of new `React.Fragment` type introduced in React 16.2 --- src/prepare.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/prepare.js b/src/prepare.js index 746603a..be0fb6a 100644 --- a/src/prepare.js +++ b/src/prepare.js @@ -66,7 +66,10 @@ function prepareElement(element, context) { return Promise.resolve([null, context]); } const { type, props } = element; - if (typeof type === 'string') { + // React.Fragment can be either a symbol or number based on the existence of + // ES2015 Symbol support of the current runtime environment. An equality + // comparison works for both cases. + if (typeof type === 'string' || type === React.Fragment) { return Promise.resolve([props.children, context]); } if (!isReactCompositeComponent(type)) {