uidotdev / usehooks

A collection of modern, server-safe React hooks – from the ui.dev team
https://usehooks.com
MIT License
9.26k stars 496 forks source link

🪲 BUG: Can't use the hooks on contextAPI file in NextJs14 #261

Closed ashrafchowdury closed 10 months ago

ashrafchowdury commented 10 months ago

Description

I've been trying to use the hooks on contextAPI file in NextJS14, but getting a strange error (Error: useLocalStorage is a client-only hook). I'd tried multiple hooks, but neither is working.

Bug Preview

Register tsx - chat-app - Visual Studio Code 11_5_2023 12_05_56 PM

ottovw commented 10 months ago

It's not a bug. The solution is described here: https://github.com/uidotdev/usehooks/issues/218#issuecomment-1681205155

Here's a issue, proposing better documentation: https://github.com/uidotdev/usehooks/issues/259