Theo's Typesafe CultTTC
Theo's Typesafe Cult3y ago
7 replies
Fredrik

How does the top-level hook rule work within other hooks?

For example, is it OK to inline other hooks like so:
export const useToken = () => ({ value: useTokenStore(s => s.value) })


Or do you need to have it like so:
const useToken = () => {
  const value = useTokenStore(s => s.value)
  return { value }
}
Was this page helpful?