You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
What does the proposed API look like?
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,
}),
};
<!-- generated by ant-design-issue-helper. DO NOT REMOVE -->
The text was updated successfully, but these errors were encountered:
benjycui
added
the
help wanted
The suggestion or request has been accepted, we need you to help us by sending a pull request.
label
Jul 13, 2017
What problem does this feature solve?
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
andlabelCol
) 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 inant-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?What does the proposed API look like?
It would be nice to have ColProps available in some format like:
The text was updated successfully, but these errors were encountered: