usehooks

A collection of modern, server-safe React hooks – from the ui.dev team (by uidotdev)

Usehooks Alternatives

Similar projects and alternatives to usehooks

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a better usehooks alternative or higher similarity.

usehooks discussion

Log in or Post with

usehooks reviews and mentions

Posts with mentions or reviews of usehooks. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-04-10.
  • React Custom Hooks: Crafting Reusable and Clean Code Like a Pro
    1 project | dev.to | 2 Aug 2024
    // https://usehooks.com/useLocalStorage import { useState } from 'react'; // Hook function useLocalStorage(key, initialValue) { // State to store our value // Pass initial state function to useState so logic is only executed once const [storedValue, setStoredValue] = useState(() => { if (typeof window === 'undefined') { return initialValue; } try { // Get from local storage by key const item = window.localStorage.getItem(key); // Parse stored JSON or if none return initialValue return item ? JSON.parse(item) : initialValue; } catch (error) { // If error also return initialValue console.log(error); return initialValue; } }); // Return a wrapped version of useState's setter function that ... // ... persists the new value to localStorage. const setValue = (value) => { try { // Allow value to be a function so we have the same API as useState const valueToStore = value instanceof Function ? value(storedValue) : value; // Save state setStoredValue(valueToStore); // Save to local storage if (typeof window !== 'undefined') { window.localStorage.setItem(key, JSON.stringify(valueToStore)); } } catch (error) { // A more advanced implementation would handle the error case console.log(error); } }; return [storedValue, setValue]; }
  • Best Next.js Libraries and Tools in 2024
    10 projects | dev.to | 10 Apr 2024
    Link: https://usehooks.com/
  • How to Track Previous State in React
    1 project | dev.to | 7 Nov 2023
    In this approach (adapted from the usehooks package), we'll define a state variable currentCounter to track counter's value:
  • Adding a real feature to a project πŸ§›
    2 projects | dev.to | 25 Oct 2023
    The very first one I came across was a package called useHooks. It looked like a really cool package with tonnes of hooks to use, and useQueue was one of them.
  • Thoughts on useEffect ?
    2 projects | /r/reactjs | 8 Jul 2023
    there are a bunch of library custom hooks, sometimes they encapsulate logic better, you should prefer them or build your own instead.
  • useHooks – A collection of Server Component safe React Hooks
    1 project | /r/u_Automatic_Fee_2323 | 31 May 2023
    1 project | /r/u_Ok-Cauliflower4514 | 31 May 2023
  • UseHooks – A Collection of Server Component Safe React Hooks
    1 project | /r/patient_hackernews | 30 May 2023
    1 project | /r/hackernews | 30 May 2023
    8 projects | news.ycombinator.com | 30 May 2023
    I saw "useDebounce" and thought "what the hell does debounce have anything to do with react render cycle?". When I check the code, `useDebounce` does... I don't even know what it does, delayed set state?

    https://github.com/uidotdev/usehooks/blob/380e83fa267157832e...

  • A note from our sponsor - SaaSHub
    www.saashub.com | 16 Sep 2024
    SaaSHub helps you find the best software and product alternatives Learn more β†’

Stats

Basic usehooks repo stats
13
9,230
7.0
about 1 month ago

Sponsored
Purpose built for real-time analytics at any scale.
InfluxDB Platform is powered by columnar analytics, optimized for cost-efficient storage, and built with open data standards.
www.influxdata.com