storybook-eol / addon-smart-knobs

🧠 This Storybook plugin uses @storybook/addon-knobs but creates the knobs automatically based on PropTypes.
https://storybooks.js.org
217 stars 36 forks source link

Composite proptypes do know work with smart knobs #26

Open lopis opened 6 years ago

lopis commented 6 years ago

Let's say I have an Input component with these prop types:

Input.propTypes = {
  value: PropTypes.string,
  error: PropTypes.bool,
  valid: PropTypes.bool,
  onChange: PropTypes.func,
  multiline: PropTypes.bool
}

Then I have a TextArea component with these prop types:

import { Input } from './Input'

TextArea.propTypes = {
  ...Input.propTypes,
  rows: PropTypes.number
}

Smart knobs correctly pick the rows prop up, but fail to show the knobs for the Input. This should work as it works with React. Why is it different in smart knobs?

lucasconstantino commented 6 years ago

This is probably an issue with babel-plugin-react-docgen. Could you have a look at that package and try and reproduce your issue? If it does reproduce, please open an issue there and mention it here ;)