Need help with react-fetching-library?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

marcin-piela
575 Stars 32 Forks MIT License 206 Commits 20 Opened issues

Description

Simple and powerful API client for react 👍 Use hooks or FACCs to fetch data in easy way. No dependencies! Just react under the hood.

Services available

!
?

Need anything else?

Contributors list

# 137,685
React
TypeScr...
JavaScr...
react-s...
117 commits
# 63,893
python-...
jython
snes
bootstr...
10 commits
# 99,795
reactjs
HTML
vuejs
CSS
4 commits
# 469,345
React
react-s...
react-h...
HTML
2 commits
# 10,672
wordpre...
PHP
JavaScr...
React
1 commit
# 50,186
Markdow...
Nextclo...
dropbox
event-h...
1 commit
# 774
GitHub
rust-la...
wechat-...
query-l...
1 commit
# 125,066
Ruby
HTML
Rails
Shell
1 commit
# 542,383
React
TypeScr...
JavaScr...
react-s...
1 commit
# 520,531
HTML
React
TypeScr...
react-s...
1 commit
# 539,282
React
react-h...
HTML
CSS
1 commit
# 468,172
JavaScr...
React
TypeScr...
react-s...
1 commit

Simple and powerful fetching library for React. Use hooks to fetch data!

[![Watch on GitHub][github-watch-badge]][github-watch][![Star on GitHub][github-star-badge]][github-star][![Tweet][twitter-badge]][twitter]


Build Status version downloads MIT License PRs Welcome Code of Conduct Code of Conduct codecov

✅ Zero dependencies (react, react-dom as peer deps)

✅ SSR support

✅ Use hooks or FACC's (Function as Child Components) - depending on your needs

✅ Uses Fetch API (but allows to use custom fetch implemenation and axios as well)

✅ Request and response interceptors allows to easily customize connection with API

✅ React Suspense support (experimental *)

✅ TypeScript support

✅ Error boundaries to catch bad API responses

✅ Less than 3k minizipped

✅ Simple cache provider - easily to extend

✅ Handle race conditions

✅ Allows to abort pending requests


react-fetching-library

Use hooks or FACC's (Function as Child Component) to fetch data in an easy way. No dependencies! Just React under the hood.

Request and response interceptors allows you to easily customize connection with API (add authorization, refresh token, cache, etc). It uses Fetch API so it can be used in SSR apps (i.e. with isomorphic-fetch).

Library allows you to use it with connection of React Suspense (read more about React Suspense) to easily maintain loading state in application.

Documentation

Full documentation is available HERE

Short example of use

import { useQuery } from 'react-fetching-library';

const fetchUsersList = { method: 'GET', endpoint: '/users', };

export const UsersListContainer = () => { const { loading, payload, error, query } = useQuery(fetchUsersList);

return ; };

Edit Basic Example

Typescript support

Inspirations

Contributing

Feel free to open PRs and issues to make this library better !

When making a PR, make sure all tests pass. If you add a new feature, please consider updating the documentation or codesandbox examples. Thank you!

Using Suspense to fetch data

For now React Suspense is not production ready to use it for fetch data as described here, so API of our component/hook may change in the future.

License

react-fetching-library is licensed under the MIT license.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.