Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement/suggestion: addAlpha is a hook, but doesn't use hook conventional name #334

Open
Taffr opened this issue Nov 20, 2024 · 0 comments
Assignees
Labels
good first issue Good for newcomers

Comments

@Taffr
Copy link

Taffr commented Nov 20, 2024

addAlpha appears to be regular function which takes a color and returns a color with a certain amount of alpha added to it.

However since this appear to be just a pure function it easy to make mistakes which would violate the rules of hooks. https://react.dev/warnings/invalid-hook-call-warning since we might conditionally do different colors for example.

Suggestion: change name to be useAddAlpha to make it more obvious that is indeed a hook.

@Taffr Taffr changed the title Improvement/suig: addAlpha hook, but doesn't use hook conventional name Improvement/suggestion: addAlpha is a hook, but doesn't use hook conventional name Nov 20, 2024
@Taffr Taffr added the good first issue Good for newcomers label Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants