@kadira/react-storybook-addon-info
Advanced tools
Comparing version 3.2.0 to 3.2.1
# Change Log | ||
### v3.2.1 | ||
* Handle false values for types [PR54](https://github.com/kadirahq/react-storybook-addon-info/pull/54) | ||
### v3.2.0 | ||
@@ -4,0 +8,0 @@ |
@@ -344,5 +344,7 @@ 'use strict'; | ||
// depth-first traverse and collect types | ||
function extract(children) { | ||
var type = children.type; | ||
if (!children) { | ||
return; | ||
} | ||
if (Array.isArray(children)) { | ||
@@ -352,12 +354,11 @@ children.forEach(extract); | ||
} | ||
if (children.props && children.props.children) { | ||
extract(children.props.children); | ||
} | ||
if (typeof children === 'string' || typeof children.type === 'string') { | ||
return; | ||
} | ||
if (!types.has(type)) { | ||
types.set(type, true); | ||
if (children.type && !types.has(children.type)) { | ||
types.set(children.type, true); | ||
} | ||
if (children.props.children) { | ||
extract(children.props.children); | ||
} | ||
} | ||
@@ -364,0 +365,0 @@ |
{ | ||
"name": "@kadira/react-storybook-addon-info", | ||
"version": "3.2.0", | ||
"version": "3.2.1", | ||
"description": "A React Storybook addon to show additional information for your stories.", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -227,5 +227,7 @@ import React from 'react'; | ||
// depth-first traverse and collect types | ||
function extract(children) { | ||
const type = children.type; | ||
if (!children) { | ||
return; | ||
} | ||
if (Array.isArray(children)) { | ||
@@ -235,12 +237,11 @@ children.forEach(extract); | ||
} | ||
if (children.props && children.props.children) { | ||
extract(children.props.children); | ||
} | ||
if (typeof children === 'string' || typeof children.type === 'string') { | ||
return; | ||
} | ||
if (!types.has(type)) { | ||
types.set(type, true); | ||
if (children.type && !types.has(children.type)) { | ||
types.set(children.type, true); | ||
} | ||
if (children.props.children) { | ||
extract(children.props.children); | ||
} | ||
} | ||
@@ -247,0 +248,0 @@ |
275853
2481