#useContext server components alternatives

2 messages · Page 1 of 1 (latest)

gusty robin
#

As useContext does not work in server components, what can I use as a lightweight alternative to access data throughout many nested components?

dry cairn
#
  1. Create a context component as client component "use client"
  2. Wrapper it at the top of layout that you want to share state