From fb09ccc9d459af399af90a8900b29665913ab292 Mon Sep 17 00:00:00 2001 From: wuhaoran <wuhaoran@kaikeba.com> Date: Tue, 23 Nov 2021 16:47:18 +0800 Subject: [PATCH] fix: build failed in commonjs, use react-is provide action in npmjs.org --- src/Children/toArray.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Children/toArray.ts b/src/Children/toArray.ts index 91ba5a41..c504903b 100644 --- a/src/Children/toArray.ts +++ b/src/Children/toArray.ts @@ -1,5 +1,5 @@ import React from 'react'; -import { isFragment } from 'react-is'; +import * as ReactIs from 'react-is'; export interface Option { keepEmpty?: boolean; @@ -18,7 +18,7 @@ export default function toArray( if (Array.isArray(child)) { ret = ret.concat(toArray(child)); - } else if (isFragment(child) && child.props) { + } else if (ReactIs.isFragment(child) && child.props) { ret = ret.concat(toArray(child.props.children, option)); } else { ret.push(child);