You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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
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.
The text was updated successfully, but these errors were encountered: