jsx-eslint/eslint-plugin-react

No corresponding propTypes declaration when export type with typescript.

Open

#3 253 ouverte le 22 mars 2022

Voir sur GitHub
 (2 commentaires) (1 réaction) (0 assignés)JavaScript (2 797 forks)batch import
bughelp wantedtypescript

Métriques du dépôt

Stars
 (8 630 stars)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

// 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;

Guide contributeur