jsx-eslint/eslint-plugin-react

No corresponding propTypes declaration when export type with typescript.

Open

#3,253 建立於 2022年3月22日

在 GitHub 查看
 (2 留言) (1 反應) (0 負責人)JavaScript (8,630 star) (2,797 fork)batch import
bughelp wantedtypescript

描述

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

貢獻者指南

No corresponding propTypes declaration when export type with typescript. · jsx-eslint/eslint-plugin-react#3253 | Good First Issue