My team is using a linter that disallows the use of PropTypes.object
. Because there are multiple instances where a shape can be formed, for these particular props (wrapperCol
and labelCol
) I would like to avoid writing the shape in each file or creating my own by copying/pasting with modification from the typescript file. I was hoping a readily made ColProps was available. After looking at the source code I see in ant-design/components/grid/col.tsx
that there is a ColProps object that would be perfect to use, but is unavailable from the node_module version my team has. Is ColProps accessible anywhere in the current version?
It would be nice to have ColProps available in some format like:
```
import React from 'react';
import PropTypes from 'prop-types';
import { Col } from 'antd';
const ColProps = Col.PropShape;
const propTypes = {
layout = PropTypes.shape({
labelCol: ColProps,
wrapperCol: ColProps,
}),
};
PR is welcomed @richardjboothe
ping~
You can try this:
import { Col } from 'antd';
PropTypes.shape(Col.propTypes);