Skip to content
This repository has been archived by the owner on Nov 10, 2017. It is now read-only.

Fix wrong detection of propType when isRequired is set #49

Merged
merged 2 commits into from Aug 11, 2016

Conversation

lukyth
Copy link
Contributor

@lukyth lukyth commented Aug 10, 2016

From the example page the propType of label is detected as other.
screen shot 2559-08-10 at 6 29 22 pm
But actually it is string, as you can see in the screenshot from example/Button.js below.
screen shot 2559-08-10 at 6 29 49 pm

As I investigated further, I realise that whenever isRequired is set in the prop, the proptype will be detected as other.

It's because in src/components/PropTable.js, PropTypesMap only store result from properties of React.PropTypes. And when the prop is set as isRequired, there's no match in PropTypesMap.

So I need to store type.isRequired in PropTypesMap as well so that isRequired prop can be detected.

@lukyth lukyth changed the title Fix wrong detection of proptype when isRequired is set Fix wrong detection of propType when isRequired is set Aug 10, 2016
@thani-sh thani-sh merged commit fbd5118 into storybook-eol:master Aug 11, 2016
@thani-sh
Copy link
Contributor

Released v3.1.3

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants