Repository: jsx-eslint/eslint-plugin-react (JavaScript)

Issue:
Version 7.25.2 missing prop-types with typescript parametrised props
### The following works alright in 7.25.1:

```jsx
type Props<ValueType> = {
  value: ValueType;
  onClick: (value: ValueType) => void;
};

// prettier-ignore
const Button = <T,>({ onClick, value }: Props<T>) => {
  return <button onClick={() => onClick(value)}>BUTTON</button>;
};

const valueObj = {
  aprop: 'avalue'
};

export default function App() {
  return (
    <div className="App">
      <h1>a button</h1>
      <Button onClick={(value) => console.log(value)} value={valueObj} />
    </div>
  );
}
```

### With version 7.25.2 same code results in react/prop-types errors
```
7:23  error  'onClick' is missing in props validation  react/prop-types
7:32  error  'value' is missing in props validation    react/prop-types
```



Discussion:
Seems like maybe #3064 caused this regression; cc @vedadeepta?
Yeah, will investigate tomorrow. ~~There seems to be just too many edge cases for generic types~~. Thanks for letting me know.

Update: not a edge case upon investigating.
Can confirm this is happening with a similar setup here.  Locking down to the previous version by adding this temporary Yarn resolution to `package.json` is a temporary workaround (note that you need to run `yarn` again after adding this):

```
{
...
    "resolutions": {
        "eslint-plugin-react": "7.25.1"
    }
...
}
```
Confirmed this issue, got 'props validation error' even using `InferGetStaticPropsType<T>` in NextJS. I've to roll back to the 7.25.1 workaround temporarily.



Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 403fcaeb08..963d7a0663 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,11 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel
 
 ## Unreleased
 
+### Fixed
+* [`prop-types`], `propTypes`: bail out unknown generic types inside func params ([#3076] @vedadeepta)
+
+[#3076]: https://github.com/yannickcr/eslint-plugin-react/pull/3076
+
 ## [7.25.2] - 2021.09.16
 
 ### Fixed
diff --git a/lib/util/propTypes.js b/lib/util/propTypes.js
index 24b83a579e..b9e397deb7 100644
--- a/lib/util/propTypes.js
+++ b/lib/util/propTypes.js
@@ -970,16 +970,6 @@ module.exports = function propTypesInstructions(context, components, utils) {
           }
         });
       } else {
-        // check if its a valid generic type when `X<{...}>`
-        if (
-          param.typeAnnotation
-          && param.typeAnnotation.typeAnnotation
-          && param.typeAnnotation.typeAnnotation.type === 'TSTypeReference'
-          && param.typeAnnotation.typeAnnotation.typeParameters != null
-          && !isValidReactGenericTypeAnnotation(param.typeAnnotation.typeAnnotation)
-        ) {
-          return;
-        }
         markPropTypesAsDeclared(node, resolveTypeAnnotation(param));
       }
     } else {


Test patch:
diff --git a/tests/lib/rules/prop-types.js b/tests/lib/rules/prop-types.js
index d02c5f94a1..55edbbbff7 100644
--- a/tests/lib/rules/prop-types.js
+++ b/tests/lib/rules/prop-types.js
@@ -3303,6 +3303,19 @@ ruleTester.run('prop-types', rule, {
 
         `,
         parser: parsers['@TYPESCRIPT_ESLINT']
+      },
+      {
+        code: `
+          type Props<ValueType> = {
+            value: ValueType;
+            onClick: (value: ValueType) => void;
+          };
+
+          const Button = <T,>({ onClick, value }: Props<T>) => {
+            return <button onClick={() => onClick(value)}>BUTTON</button>;
+          };
+        `,
+        parser: parsers['@TYPESCRIPT_ESLINT']
       }
     ]),
     {
@@ -6865,6 +6878,23 @@ ruleTester.run('prop-types', rule, {
           }
         ],
         parser: parsers['@TYPESCRIPT_ESLINT']
+      },
+      {
+        code: `
+          type PersonProps<T> = {
+              x: T;
+          }
+          const Person = (props: PersonProps<string>): React.ReactElement => (
+              <div>{props.username}</div>
+          );
+        `,
+        errors: [
+          {
+            messageId: 'missingPropType',
+            data: {name: 'username'}
+          }
+        ],
+        parser: parsers['@TYPESCRIPT_ESLINT']
       }
     ])
   )