poke-hooks
TypeScript icon, indicating that this package has built-in type declarations

0.5.3 • Public • Published

poke-hooks

React Hooks for Pokemon API with Typescript

poke-hooks-example

## usePokemon
usePokemon(name: string | number) : {
  data: Pokemon | null;
  isLoading: boolean;
}

Example

import { usePokemon } from "poke-hooks";

const Poke = () => {
  const { data, isLoading } = usePokemon("pikachu"); // set name or number
  if (isLoading) {
    return <div>loading... </div>;
  }
  return (
    <div>
      <p> name: {data.name} </p>
    </div>
  );
};

Readme

Keywords

none

Package Sidebar

Install

npm i poke-hooks

Weekly Downloads

0

Version

0.5.3

License

MIT

Unpacked Size

842 kB

Total Files

18

Last publish

Collaborators

  • junow