Skip to content

rule to ensure forwardRef includes a ref argument. #3158

Closed
@jquense

Description

@jquense

Howdy, not sure if this is a question or suggestion for a new rule, but i've not managed to find an existing rule to cover it.

But i'd like to find a rule that flags the following as an error, because the ref argument is not present.

import { forwardRef } from 'react';

const Button = forwardRef(props => <button {...props} />)

Whether or not the ref is used is already handled by no-unused-vars.

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