-
-
Notifications
You must be signed in to change notification settings - Fork 302
Closed
Labels
Description
This issue came with the version 2.12.0
.
And we got this while working with our babel plugin for doc gen.
Assume we've a stateless component like this:
const Button = ({ children, onClick, style = {} }) => (
<button
style={{ }}
onClick={onClick}
>
{children}
</button>
);
Button.propTypes = {
children: React.PropTypes.string.isRequired,
onClick: React.PropTypes.func,
style: React.PropTypes.object,
};
export default Button;
Then generated info like this:
{
description: '',
props: {
children: {
type: {
name: 'string'
},
required: true,
description: '',
defaultValue: {
value: 'children',
computed: true
}
},
onClick: {
type: {
name: 'func'
},
required: false,
description: '',
defaultValue: {
value: 'onClick',
computed: true
}
},
style: {
type: {
name: 'object'
},
required: false,
description: '',
defaultValue: {
value: '{}',
computed: false
}
}
}
}
Just look at the default values for onClick
or children
.
This doesn't seems to be correct to me.