Skip to content

Commit

Permalink
[Fix] prop-types: props missing in validation when using generic ty…
Browse files Browse the repository at this point in the history
…pes from a namespace import
  • Loading branch information
rbondoc96 committed Dec 3, 2024
1 parent d5da0a6 commit e1eb228
Show file tree
Hide file tree
Showing 2 changed files with 467 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/util/propTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,10 @@ module.exports = function propTypesInstructions(context, components, utils) {
const defaults = { customValidators: [] };
const configuration = Object.assign({}, defaults, context.options[0] || {});
const customValidators = configuration.customValidators;
const allowedGenericTypes = new Set(['forwardRef', 'ForwardRefRenderFunction', 'VFC', 'VoidFunctionComponent', 'PropsWithChildren', 'SFC', 'StatelessComponent', 'FunctionComponent', 'FC']);
const allowedGenericTypes = new Set(['ComponentProps', 'ComponentPropsWithoutRef', 'forwardRef', 'ForwardRefRenderFunction', 'VFC', 'VoidFunctionComponent', 'PropsWithChildren', 'SFC', 'StatelessComponent', 'FunctionComponent', 'FC']);
const genericTypeParamIndexWherePropsArePresent = {
ComponentProps: 0,
ComponentPropsWithoutRef: 0,
ForwardRefRenderFunction: 1,
forwardRef: 1,
VoidFunctionComponent: 0,
Expand Down
Loading

0 comments on commit e1eb228

Please sign in to comment.