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

Allow 'ref' and 'prop' abbreviations #36

Open
3 of 4 tasks
dkacper opened this issue Sep 13, 2023 · 0 comments
Open
3 of 4 tasks

Allow 'ref' and 'prop' abbreviations #36

dkacper opened this issue Sep 13, 2023 · 0 comments

Comments

@dkacper
Copy link

dkacper commented Sep 13, 2023

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant