error TS2314: Generic type ‘Component’ requires 2 type argument(s)

The P is the props type and the S is the state type. You’ll want to change:

class MyComponent extends React.Component { ...

to:

interface MyProps {}
interface MyState {}

class MyComponent extends React.Component<MyProps, MyState> { ...

Then expand the MyProps and MyState interfaces to include typing for all the props and state that the component needs.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)