jsx-eslint/eslint-plugin-react

No corresponding propTypes declaration when export type with typescript.

Open

#3253 aperta il 22 mar 2022

Vedi su GitHub
 (2 commenti) (1 reazione) (0 assegnatari)JavaScript (2797 fork)batch import
bughelp wantedtypescript

Metriche repository

Star
 (8630 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

// Will get error: defaultProp "data" has no corresponding propTypes declaration
// from react/default-props-match-prop-types
export type TableProps = {
  data?: any;
};

const defaultProps = {
  data: null,
};

const Table: FC<TableProps> = ({ data }) => null;
// working well
type TableProps = {
  data?: any;
};

const defaultProps = {
  data: null,
};

const Table: FC<TableProps> = ({ data }) => null;

Guida contributor