Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jdelucaa/hooks-library

React custom hooks library
https://github.com/jdelucaa/hooks-library

Last synced: about 16 hours ago
JSON representation

React custom hooks library

Awesome Lists containing this project

README

        

# hooks-library

> React Hooks Library

[![NPM](https://img.shields.io/npm/v/hooks-library.svg)](https://www.npmjs.com/package/hooks-library)

## Install

```bash
npm install --save hooks-library
```

### Available hooks

[useAxiosGet](#useAxiosGet)
[useBreakpoint](#useBreakpoint)
[useFormInput](#useFormInput)

### `useAxiosGet`

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

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

return (


{isError &&
Something went wrong...
}
{isLoading ?
Loading...
:
{data}
}

);
};
```

### `useBreakpoint`

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

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

return

{brkPnt}
;
};
```

### `useFormInput`

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

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

return (




);
};
```

## License

MIT © [jdelucaa](https://github.com/jdelucaa)