Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

Allow 'ref' and 'prop' abbreviations #36

@dkacper

Description

@dkacper

Describe the feature

When working with refs in React it is a standard thing to call them just ref. For example when forwarding ref:

const component = forwardRef((props, ref) => ( ... ))

Another common thing is to use single form of props – a prop. For example when we have to alias a prop name that component accepts:

const { id: idProp } = props
const defaultId = useId()
const id = idProp ?? defaultId

These a two real-life examples. Can we allow ref and prop abbreviations as well? We could simply add it to the this list.

replacements: {
  ref: false,
  prop: false,
  ...
}

Additional information

  • Would you be willing to help implement this feature?
  • Could this feature be implemented as a module?

Final checks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions