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
I wanted to share some feedback regarding the naming conventions for props in the framework, particularly in relation to the use prefix.
I believe using the use prefix for props can be somewhat misleading in the context of React. This is primarily because it collides with React's naming convention for hooks. Although I haven't encountered any actual issues yet where a prop is mistakenly identified as a React hook by the linter, this can easily lead to confusion for developers. When we see the use prefix, we naturally expect that what follows is a hook.
Additionally, I noticed a potential name collision when using it with the official Keycloak provider. Here’s an example:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi There,
I wanted to share some feedback regarding the naming conventions for props in the framework, particularly in relation to the
use
prefix.I believe using the
use
prefix for props can be somewhat misleading in the context of React. This is primarily because it collides with React's naming convention for hooks. Although I haven't encountered any actual issues yet where a prop is mistakenly identified as a React hook by the linter, this can easily lead to confusion for developers. When we see theuse
prefix, we naturally expect that what follows is a hook.Additionally, I noticed a potential name collision when using it with the official Keycloak provider. Here’s an example:
In this case, the
useKeycloak
from the provider conflicts with theuseKeycloak
defined inTheiaCloudConfig
.Maybe you can consider these as you evolve the framework to 2.0.
Thank you for your contributions to open-source ❤️
Beta Was this translation helpful? Give feedback.
All reactions