diff --git a/addons/knobs/README.md b/addons/knobs/README.md index aead8b928864..e70eb53e5a30 100644 --- a/addons/knobs/README.md +++ b/addons/knobs/README.md @@ -161,7 +161,7 @@ const value = color(label, defaultValue); ### object -Allows you to get a JSON object from the user. +Allows you to get a JSON object or array from the user. ```js import { object } from '@storybook/addon-knobs'; @@ -178,7 +178,7 @@ const value = object(label, defaultValue); ### array -Allows you to get an array from the user. +Allows you to get an array of strings from the user. ```js import { array } from '@storybook/addon-knobs'; diff --git a/addons/knobs/src/components/types/Object.js b/addons/knobs/src/components/types/Object.js index 84084144b492..f97eac2b44b8 100644 --- a/addons/knobs/src/components/types/Object.js +++ b/addons/knobs/src/components/types/Object.js @@ -88,7 +88,7 @@ ObjectType.defaultProps = { ObjectType.propTypes = { knob: PropTypes.shape({ name: PropTypes.string, - value: PropTypes.object, + value: PropTypes.oneOfType([PropTypes.object, PropTypes.array]), }), onChange: PropTypes.func, };