jsx-eslint/eslint-plugin-react

No corresponding propTypes declaration when export type with typescript.

Open

#3.253 geöffnet am 22. März 2022

Auf GitHub ansehen
 (2 Kommentare) (1 Reaktion) (0 zugewiesene Personen)JavaScript (8.630 Stars) (2.797 Forks)batch import
bughelp wantedtypescript

Beschreibung

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

Contributor Guide