From 3de04f89d4466cf929cce95e1076d4239ff6f1c2 Mon Sep 17 00:00:00 2001 From: grguang <945455382@qq.com> Date: Thu, 12 Sep 2019 09:46:37 +0800 Subject: [PATCH] Fix: * create Component props add boolean handle function; --- packages/devtools-conversion/src/createClass.js | 3 +++ .../devtools-conversion/test/__snapshots__/index.test.js.snap | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/devtools-conversion/src/createClass.js b/packages/devtools-conversion/src/createClass.js index bae85f7..33dfcb2 100644 --- a/packages/devtools-conversion/src/createClass.js +++ b/packages/devtools-conversion/src/createClass.js @@ -220,6 +220,9 @@ export function handlePropsType(propsItem?: any): string { if (type === 'object') { return `{ ${JSON.stringify(propsItem)} }`; } + if (type === 'boolean') { + return `{ ${propsItem} }`; + } if (type === 'number') { return `{ ${propsItem} }`; } diff --git a/packages/devtools-conversion/test/__snapshots__/index.test.js.snap b/packages/devtools-conversion/test/__snapshots__/index.test.js.snap index 93ac3da..f60154b 100644 --- a/packages/devtools-conversion/test/__snapshots__/index.test.js.snap +++ b/packages/devtools-conversion/test/__snapshots__/index.test.js.snap @@ -35,7 +35,7 @@ exports[`conversion index -> Card Container 1`] = ` height: 102 + 'px', zIndex: '0', left: 42 + 'px', top: 71 + 'px' }} - >