8000 [explicit-function-return-type] Correct return type for React function components · Issue #814 · typescript-eslint/typescript-eslint · GitHub
[go: up one dir, main page]

Skip to content
[explicit-function-return-type] Correct return type for React function components #814
Closed
@flopes89

Description

@flopes89

Repro

{
  "extends": "plugin:@typescript-eslint/recommended"
}
const MyComp: React.FC<MyProps> = (props): ???? => {
   return (
      <div>Hello World</div>
   );
};

What's the correct/recommended return type for the function when this rule tells me that I am required to use one?

I would assume it's inferred, but that doesn't seem to happen?

Versions

package version
@typescript-eslint/eslint-plugin 1.13.0
@typescript-eslint/parser 1.13.0
TypeScript 3.4.3
ESLint 5.16.0
node 10.15.3
npm 6.4.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    package: eslint-pluginIssues related to @typescript-eslint/eslint-pluginquestionQuestions! (i.e. not a 344E bug / enhancment / documentation)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0