diff --git a/examples/cra-ts-kitchen-sink/src/stories/docgen-tests/types/ext.js b/examples/cra-ts-kitchen-sink/src/stories/docgen-tests/types/ext.js new file mode 100644 index 00000000000..df0f646a519 --- /dev/null +++ b/examples/cra-ts-kitchen-sink/src/stories/docgen-tests/types/ext.js @@ -0,0 +1,12 @@ +import PropTypes from 'prop-types'; + +export const PRESET_SHAPE = { + text: PropTypes.string.isRequired, + startDate: PropTypes.object.isRequired, + endDate: PropTypes.object.isRequired, +}; + +export const SOME_PROP_TYPES = { + ext1: PropTypes.string, + ext2: PropTypes.number, +}; diff --git a/examples/cra-ts-kitchen-sink/src/stories/docgen-tests/types/prop-types.js b/examples/cra-ts-kitchen-sink/src/stories/docgen-tests/types/prop-types.js index bcd6246ad96..71cbc5841cb 100644 --- a/examples/cra-ts-kitchen-sink/src/stories/docgen-tests/types/prop-types.js +++ b/examples/cra-ts-kitchen-sink/src/stories/docgen-tests/types/prop-types.js @@ -1,6 +1,8 @@ +/* eslint-disable react/require-default-props */ /* eslint-disable react/no-unused-prop-types */ import React from 'react'; import PropTypes, { string, shape } from 'prop-types'; +import { PRESET_SHAPE, SOME_PROP_TYPES } from './ext'; const NAMED_OBJECT = { text: PropTypes.string.isRequired, @@ -159,6 +161,7 @@ PropTypesProps.propTypes = { ), }) ), + arrayExternalShape: PropTypes.arrayOf(PropTypes.shape(PRESET_SHAPE)), /** * A simple `objectOf` propType. */ @@ -257,6 +260,7 @@ PropTypesProps.propTypes = { requiredString: PropTypes.string.isRequired, nullDefaultValue: PropTypes.string, undefinedDefaultValue: PropTypes.string, + ...SOME_PROP_TYPES, }; PropTypesProps.defaultProps = {