Skip to content

No corresponding propTypes declaration when export type with typescript. #3253

Open
@xyy94813

Description

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions