ei-fetch

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

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

✅ Use hooks

Documentation

Short example of use

import { useFetch } from "ei-fetch";

const fetchUsersList = {
  url: 'https://jsonplaceholder.typicode.com/users'
};

export const UsersListContainer = () => {
  const { data, isError, isLoading } = useFetch(fetchUsersList);

  if (isLoading) return <h1>isLoading</h1>;
  if (isError) return <h1>isErroro</h1>;

  return <UsersList isLoading={isLoading} isError={isError} users={data} />;
};

Typescript support

Inspirations

GitHub

View Github