atlassian / atlassian/extract-react-types

Default values for props are not always extracted

Open
#155 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
188
Forks
31
PR merge metrics
No merged PRs in 30d

Description

The default value for props does not always seem to get extracted by `extract-react-types`.

One place where this is very visible is https://atlassian.design/components/button/code which has no default value information (despite having default values for many of the props).

As @danieldelcore indicated on Slack this is likely because:
> I suspect it only pulls defaults off a component from the Component.defaultProps property or via static defaultProps rather than destructured function args

It would be great if `extract-react-types` could support extracting default values for props that are defined through default values on destructured function args 😄

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.