Skip to content

disallow calling functional components #3453

Open
@dwelle

Description

@dwelle

Disallow rendering functional components by calling them.

const SomeComponent = () => <div>oi</div>;

// No
export default App () => {
  return SomeComponent();
}

// Yes please
export default App () => {
  return <SomeComponent/>;
}

Hard to say how to identify, but I think that disallowing to call capital-case functions inside jsx/tsx files is a reasonable heuristic.

Note, there's a seemingly duplicate issue #3208 with the proper name, but then talking about something completely different (render functions).

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