<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ravi Bharti</title>
    <description>The latest articles on DEV Community by Ravi Bharti (@ravics1721).</description>
    <link>https://dev.to/ravics1721</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F347693%2Fd3d0be4b-570b-4503-ad48-68f9d6c83f2a.png</url>
      <title>DEV Community: Ravi Bharti</title>
      <link>https://dev.to/ravics1721</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ravics1721"/>
    <language>en</language>
    <item>
      <title>Top 10 Awesome React Hooks Libraries</title>
      <dc:creator>Ravi Bharti</dc:creator>
      <pubDate>Sun, 21 Aug 2022 18:49:35 +0000</pubDate>
      <link>https://dev.to/ravics1721/top-10-awesome-react-hooks-libraries-1924</link>
      <guid>https://dev.to/ravics1721/top-10-awesome-react-hooks-libraries-1924</guid>
      <description>&lt;p&gt;Hooks in React has been life-changing for React developers they provide a simple elegant way to write code that is more readable and maintainable. There are only a few handfuls of hooks provided by React depending on our use case we create custom hooks.&lt;/p&gt;

&lt;p&gt;Before creating our own custom we can look up to following react hooks libraries that help in the project.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. React Hooks Form
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/react-hook-form/react-hook-form"&gt;&lt;em&gt;&lt;strong&gt;Github&lt;/strong&gt;&lt;/em&gt;&lt;/a&gt;   &lt;a href="https://www.react-hook-form.com/"&gt;&lt;em&gt;Docs&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;React Hooks for form state management and validation (Web + React Native). It reduces the amount of code you need to write while removing unnecessary re-renders.&lt;/p&gt;

&lt;h4&gt;
  
  
  Features
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Built with performance, UX, and DX in mind&lt;/li&gt;
&lt;li&gt;Embraces native HTML form validation&lt;/li&gt;
&lt;li&gt;Out-of-the-box integration with UI libraries&lt;/li&gt;
&lt;li&gt;Small size and no dependencies&lt;/li&gt;
&lt;li&gt;Support Yup, Zod, AJV, Superstruct, Joi, Vest, class-validator, io-ts, nope, and custom build&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. React Use
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/streamich/react-use"&gt;&lt;em&gt;Github&lt;/em&gt;&lt;/a&gt;  &lt;a href="https://usehooks.com/"&gt;&lt;em&gt;Docs&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;React use has a collection of essential React Hooks for managing devices sensors, UI controls, animations, side-effects, Lifecycle, State, and more &lt;/p&gt;

&lt;h3&gt;
  
  
  3. React Query
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/TanStack/query"&gt;&lt;em&gt;Github&lt;/em&gt;&lt;/a&gt; &lt;a href="https://tanstack.com/query/"&gt;&lt;em&gt;Docs&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hooks for fetching, caching, and updating asynchronous data in React. It has declarative, always-up-to-date auto-managed queries and mutations that directly improve both your developer and user experiences&lt;/p&gt;

&lt;h4&gt;
  
  
  Features
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Transport/protocol/backend agnostic data fetching (REST, GraphQL, promises, whatever!)&lt;/li&gt;
&lt;li&gt;Auto Caching + Refetching (stale-while-revalidate, Window Refocus, Polling/Realtime)&lt;/li&gt;
&lt;li&gt;Parallel + Dependent Queries&lt;/li&gt;
&lt;li&gt;Mutations + Reactive Query Refetching&lt;/li&gt;
&lt;li&gt;Multi-layer Cache + Automatic Garbage Collection&lt;/li&gt;
&lt;li&gt;Paginated + Cursor-based Queries&lt;/li&gt;
&lt;li&gt;Load-More + Infinite Scroll Queries w/ Scroll Recovery&lt;/li&gt;
&lt;li&gt;Request Cancellation&lt;/li&gt;
&lt;li&gt;React Suspense + Fetch-As-You-Render Query Prefetching&lt;/li&gt;
&lt;li&gt;Dedicated Devtools
...&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. useDebounce
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/xnimorz/use-debounce"&gt;&lt;em&gt;Github&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;React hook for value and callback debouncing&lt;/p&gt;

&lt;h3&gt;
  
  
  5. useHooks-ts
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/juliencrn/usehooks-ts"&gt;&lt;em&gt;Github&lt;/em&gt;&lt;/a&gt;  &lt;a href="https://usehooks-ts.com/"&gt;&lt;em&gt;Docs&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It has a lot of hooks for many of the handful use cases of the application lifecycle, Here are some of the following: &lt;code&gt;useCopyToClipboard()&lt;/code&gt; &lt;code&gt;useDarkMode()&lt;/code&gt; &lt;code&gt;useEventListener()&lt;/code&gt; &lt;code&gt;useIsMounted()&lt;/code&gt; &lt;code&gt;useMap()&lt;/code&gt; &lt;code&gt;useSsr()&lt;/code&gt; &lt;code&gt;useStep()&lt;/code&gt; and many more.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Constate
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/diegohaz/constate"&gt;&lt;em&gt;Github&lt;/em&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;It let create local states using React Hooks and use it as a React Context only when needed with minimum effort&lt;/p&gt;

&lt;h3&gt;
  
  
  7. useHttp
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/ava/use-http"&gt;&lt;em&gt;Github&lt;/em&gt;&lt;/a&gt; &lt;a href="https://use-http.com/#/"&gt;&lt;em&gt;Docs&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is an awesome package that is used as the replacement of Fetch API&lt;/p&gt;

&lt;h4&gt;
  
  
  Features
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;SSR (server-side rendering) support&lt;/li&gt;
&lt;li&gt;TypeScript support&lt;/li&gt;
&lt;li&gt;2 dependencies (use-ssr, urs)&lt;/li&gt;
&lt;li&gt;GraphQL support (queries + mutations)&lt;/li&gt;
&lt;li&gt;Provider to set default URL and options&lt;/li&gt;
&lt;li&gt;Request/response interceptors&lt;/li&gt;
&lt;li&gt;React Native support&lt;/li&gt;
&lt;li&gt;Aborts/Cancels pending HTTP requests when a component unmounts&lt;/li&gt;
&lt;li&gt;Built in caching&lt;/li&gt;
&lt;li&gt;Persistent caching support&lt;/li&gt;
&lt;li&gt;Suspense(experimental) support&lt;/li&gt;
&lt;li&gt;Retry functionality&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  8. useMedia
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/streamich/use-media"&gt;&lt;em&gt;Github&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;React sensor hook that tracks the state of a CSS media query. It takes a straightforward solution to the issue as media queries are extremely critical for the responsiveness of any application or website&lt;/p&gt;

&lt;h3&gt;
  
  
  9. rehooks/local-storage
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/rehooks/local-storage"&gt;&lt;em&gt;Github&lt;/em&gt;&lt;/a&gt; &lt;a href="https://rehooks.github.io/local-storage/"&gt;&lt;em&gt;Docs&lt;/em&gt;&lt;/a&gt;&lt;br&gt;
React hook for enabling synchronization with local storage.&lt;/p&gt;

&lt;h4&gt;
  
  
  Features
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Automatic JSON serialization&lt;/li&gt;
&lt;li&gt;Synchronization across multiple tabs&lt;/li&gt;
&lt;li&gt;Synchronization across multiple tabs&lt;/li&gt;
&lt;li&gt;Type hinting via TypeScript&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  10. React Hanger
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/kitze/react-hanger"&gt;&lt;em&gt;Github&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Set of helpful hooks, for specific to some primitives types state changing helpers&lt;br&gt;
react-hanger is a library that has some React Hooks that let us more easily manage various kinds of states. Here are some following Hooks: &lt;code&gt;useInput&lt;/code&gt;  &lt;code&gt;useBoolean&lt;/code&gt; &lt;code&gt;useNumber&lt;/code&gt; &lt;code&gt;useArray&lt;/code&gt; &lt;code&gt;useOnMount&lt;/code&gt; &lt;code&gt;useOnUnmount&lt;/code&gt; and many more...&lt;/p&gt;

&lt;h2&gt;
  
  
  Bonus
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/rehooks/awesome-react-hooks"&gt;&lt;strong&gt;awesome-react-hooks&lt;/strong&gt;&lt;/a&gt; A curated resource of react hooks&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/craig1123/react-recipes"&gt;**React Recieps&lt;/a&gt; A React Hooks utility library containing popular customized hooks&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/rehooks/component-size"&gt;&lt;strong&gt;component-size&lt;/strong&gt;&lt;/a&gt; React hook for determining the size of a component&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/rehooks/online-status"&gt;&lt;strong&gt;online-status&lt;/strong&gt;&lt;/a&gt; React hook for subscribing to online/offline events and the navigator.onLine property to see the current status&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Hooks are reusable, clean, and simple functions that can be incorporated into your workflow. They offer us many options for a diverse range of uses, so we don’t have to build them from scratch.&lt;/p&gt;

&lt;p&gt;There are also many more hooks libraries out there, I have only selected which are most popular and maintained, if I have missed any good libraries, write them down in the comment section. &lt;/p&gt;

&lt;p&gt;Thank you for reading..!!&lt;/p&gt;

&lt;h3&gt;
  
  
  Credits
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Cover Photo by Rachel Claire: &lt;a href="https://www.pexels.com/photo/brown-rope-and-a-metal-cargo-hook-6750210/"&gt;https://www.pexels.com/photo/brown-rope-and-a-metal-cargo-hook-6750210/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>react</category>
      <category>reacthook</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
