3.3.6 • Published 8 days ago

http-react v3.3.6

Weekly downloads
-
License
MIT
Repository
github
Last release
8 days ago

HTTP React

Http React is a React hooks library for data fetching. It's built on top of the native Fetch API.

Overview

With one hook call, you get all the information about a request that you can use to build UIs that are consistent and performant:

import useFetch from 'http-react'

// This is the default
const fetcher = (url, config) => fetch(url, config)

export default function App() {
  const { data, loading, error, responseTime } = useFetch('/api/user-info', {
    refresh: '30 sec',
    fetcher
  })

  if (loading) return <p>Loading</p>

  if (error) return <p>An error ocurred</p>

  return (
    <div>
      <h2>Welcome, {data.name}</h2>
      <small>Profile loaded in {responseTime} miliseconds</small>
    </div>
  )
}

It supports many features that are necessary in modern applications, while giving developers full control over the request configuration:

  • Server-Side Rendering
  • Server actions
  • React Native
  • Request deduplication
  • Suspense
  • Refresh
  • Retry on error
  • Pagination
  • Local mutation (Optimistic UI)
  • qraphql

and more!

Installation:

npm install --save http-react

Or

yarn add http-react

For production apps

<!-- Add React and ReactDOM -->
<script
  src="https://unpkg.com/react@18.2.0/umd/react.production.min.js"
  crossorigin
></script>

<script
  src="https://unpkg.com/react-dom@18.2.0/umd/react-dom.production.min.js"
  crossorigin
></script>

<!-- Add Http React -->
<script src="https://unpkg.com/http-react/dist/browser/http-react.min.js"></script>

Getting started

3.3.6

8 days ago

3.3.5

8 days ago

3.3.4

12 days ago

3.3.1

13 days ago

3.3.0

13 days ago

3.3.3

13 days ago

3.3.2

13 days ago

3.2.9

18 days ago

3.2.8

19 days ago

3.2.7

20 days ago

3.2.6

1 month ago

3.2.5

3 months ago

3.2.4

3 months ago

3.2.1

5 months ago

3.2.3

5 months ago

3.2.0

5 months ago

3.1.0

6 months ago

3.0.6

7 months ago

3.0.5

1 year ago

3.0.4

1 year ago

3.0.3

1 year ago

3.0.2

1 year ago

3.0.1

1 year ago

3.0.0

1 year ago

2.9.9

1 year ago

2.9.8

1 year ago

2.9.7

1 year ago

2.9.6

1 year ago

2.9.5

1 year ago

2.9.4

1 year ago

2.9.3

1 year ago

2.9.2

1 year ago

2.9.1

1 year ago

2.9.0

1 year ago

2.8.3

1 year ago

2.8.2

1 year ago

2.8.1

1 year ago

2.8.0

1 year ago

2.7.9

1 year ago

2.7.8

1 year ago

2.7.7

1 year ago

2.7.6

1 year ago

2.7.5

1 year ago

2.7.4

1 year ago

2.7.3

1 year ago

2.7.2

1 year ago

2.7.1

1 year ago

2.7.0

1 year ago

2.6.9

1 year ago

2.6.8

1 year ago

2.6.7

1 year ago

2.6.6

1 year ago

2.6.5

1 year ago

2.6.4

1 year ago

2.6.3

1 year ago

2.6.2

1 year ago

2.6.1

1 year ago

2.6.0

1 year ago

2.5.9

1 year ago

2.5.8

1 year ago

2.5.7

1 year ago

2.5.6

1 year ago

2.5.5

1 year ago

2.5.4

1 year ago

2.5.3

1 year ago

2.5.2

1 year ago

2.5.1

1 year ago

2.5.0

1 year ago

2.4.9

1 year ago

2.4.8

1 year ago

2.4.7

1 year ago

2.4.6

1 year ago

2.4.5

1 year ago

2.4.4

1 year ago

2.4.3

1 year ago

2.4.2

1 year ago

2.4.1

1 year ago

2.4.0

1 year ago

2.3.9

1 year ago