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

https://github.com/arjun1237/dr-hooks

everday custom hooks for react developers
https://github.com/arjun1237/dr-hooks

Last synced: 2 months ago
JSON representation

everday custom hooks for react developers

Awesome Lists containing this project

README

          

# What is this ?

Everyday custom hooks for react developers.

# Installation

`npm i dr-hooks`

# How to use them ?

### useInputState hook (example)
```
import { useInputState } from 'dr-hooks';

function App(){
const init = {
password: "",
username: ""
}

const {password, username, update} = useInputState(init)

const handleChange = (e) => {
update(e)
}

const handleSubmit = (e) => {
e.preventDefault()
// handle form submit
}

return (



SUBMIT

)
}
```

**Arguments for useInputState hook function**

* *init* - initial value is required