React Hooks Library
npm install --save hooks-library
useAxiosGet
useBreakpoint
useFormInput
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>
);
};
import React, { Component } from 'react';
import { useBreakpoint } from 'hooks-library';
const Example = () => {
const brkPnt = useBreakpoint();
return <div>{brkPnt}</div>;
};
import React, { Component } from 'react';
import { useFormInput } from 'hooks-library';
const Example = () => {
const value = useFormInput();
return (
<div>
<input {...value} />
</div>
);
};
MIT © jdelucaa