Last active
November 23, 2021 08:13
-
-
Save kof/43ac135686c71c536deb0db61b94e6e3 to your computer and use it in GitHub Desktop.
Inject styles with custom hooks
@Janpot The problem with using props directly is that we wouldn't be able to reuse stylesheets across different component instances as soon as you introduce props.
The second problem with that would be the injection order (this is also the reason why we need createUseStyles
function right now).
how can i use a hook from inside a separate style file ?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Pure from an API consumer point of view, I think I'd prefer to do:
Basically: 1 class per hook, and use props directly. Pass an array similar to
useEffect
to control recalculations.