strothj / react-docgen-typescript-loader

Webpack loader to generate docgen information from Typescript React components.
Other
360 stars 47 forks source link

defaultProps as variable #68

Open tiagoporto opened 4 years ago

tiagoporto commented 4 years ago

My component uses a config as defaultProps

const config = {
  color: 'primary'
}

MyComponent.defaultProps = {
  color: config.color
}

When the doc is generated the default value is generated not with the variable value primary, but by his name config.color

Annotation 2019-11-08 134249

If I use static value works fine

Is there a way to make it work?