Closed
Description
Importing prop types is a fairly common use case which doesn't appear to be possible at this stage. Any plans to support this pattern?
Example:
// defaultPropTypes.js
import { PropTypes } from 'react';
export default {
prop1: PropTypes.string
};
// otherPropTypes.js
import { PropTypes } from 'react';
export default {
prop2: PropTypes.object
};
// MyComponent.jsx
import { Component } from 'react';
import defaultPropTypes from './defaultPropTypes.js';
import otherPropTypes './otherPropTypes.js';
export default class MyComponent extends Component {
static propTypes = {
...defaultPropTypes,
...otherPropTypes
}
// etc...
}
Results in:
{
"MyComponent.jsx": {
"description": ""
}
}