1.0.1-beta • Published 1 year ago

@calizahq/react-hooks v1.0.1-beta

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@calizahq/react-hooks

Caliza react hooks

Features

  • ES6 syntax, managed with Prettier + Eslint
  • React 17
  • React-Query
  • Typescript

Install

yarn add @calizahq/react-hooks
// or
npm i @calizahq/react-hooks

Requirements

  • React 16.8

Usage

import { useAPI } from "@calizahq/react-hooks";
import { Loader, Avatar } from "@calizahq/react-components";
import { useState } from "react";

export const App = () => {
  const { isLoading, user } = useAPI("/me");
  if (isLoading) {
    return <Loader />;
  }

  return (
    <div>
      <Avatar user={user} />
      {user.name}
    </div>
  );
};
import { APIContextProvider } from "@calizahq/react-hooks";
import * as ReactDOM from "react-dom";
import { App } from "./App";

ReactDOM.render(
  <APIContextProvider basePath={"https://api.domain.com"}>
    <App />
  </APIContextProvider>,
  document.getElementById("root")
);
1.0.1-beta

1 year ago

6.98.1

1 year ago

5.97.1

1 year ago

4.96.1

1 year ago

3.95.1

1 year ago

2.94.1

1 year ago

1.93.1

1 year ago