hooks-library

1.0.1 • Public • Published

hooks-library

React Hooks Library

NPM

Install

npm install --save hooks-library

Available hooks

useAxiosGet
useBreakpoint
useFormInput

useAxiosGet

import React, { Component } from 'react';
import { useAxiosGet } from 'hooks-library';

const Example = () => {
  const [{ data, isLoading, isError }] = useAxiosGet('url');

  return (
    <div>
      {isError && <div>Something went wrong...</div>}
      {isLoading ? <div>Loading...</div> : <div>{data}</div>}
    </div>
  );
};

useBreakpoint

import React, { Component } from 'react';
import { useBreakpoint } from 'hooks-library';

const Example = () => {
  const brkPnt = useBreakpoint();

  return <div>{brkPnt}</div>;
};

useFormInput

import React, { Component } from 'react';
import { useFormInput } from 'hooks-library';

const Example = () => {
  const value = useFormInput();

  return (
    <div>
      <input {...value} />
    </div>
  );
};

License

MIT © jdelucaa

Readme

Keywords

none

Package Sidebar

Install

npm i hooks-library

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

103 kB

Total Files

7

Last publish

Collaborators

  • jdelucak