hooks-library
v1.0.1
Published
React Hooks Library
Downloads
2
Readme
hooks-library
React Hooks Library
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