Skip to content

Commit

Permalink
fix: Fix decorator support and allow default props to be missing
Browse files Browse the repository at this point in the history
  • Loading branch information
bebraw committed Mar 10, 2019
1 parent 914e372 commit 42fbdb6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/extract-react-types/src/index.js
Expand Up @@ -189,6 +189,10 @@ function convertReactComponentFunction(path, context) {
}

function addDefaultProps(props, defaultProps) {
if (!defaultProps) {
return props;
}

defaultProps.forEach(property => {
let ungeneric = resolveFromGeneric(props);
const prop = getProp(ungeneric, property);
Expand Down Expand Up @@ -1426,7 +1430,7 @@ function getContext(
filename /*:? string */,
resolveOptions /*:? Object */
) {
let plugins = ['jsx'];
let plugins = ['jsx', ['decorators', { decoratorsBeforeExport: true }]];
/* eslint-disable-next-line no-param-reassign */
if (!resolveOptions) resolveOptions = {};

Expand Down

0 comments on commit 42fbdb6

Please sign in to comment.