jsx-eslint/eslint-plugin-react

No corresponding propTypes declaration when export type with typescript.

Open

#3.253 aberto em 22 de mar. de 2022

Ver no GitHub
 (2 comments) (1 reaction) (0 assignees)JavaScript (8.630 stars) (2.797 forks)batch import
bughelp wantedtypescript

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;

Guia do colaborador