# react-short-hook

> google authentication hooks for reset password only. **testing purpose**.

Latest version **0.1.1** (published 2022-05-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-short-hook
pnpm add react-short-hook
yarn add react-short-hook
bun add react-short-hook
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2022-05-16 |
| First published | 2022-05-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 0 |
| Unpacked size | 13.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | sabbir-dcy |
| Maintainers | sabbir-pblc |
| Keywords | react, hook, firebase |

## Links

- npm: https://www.npmjs.com/package/react-short-hook
- Repository: https://github.com/sabbir-dcy/react-short-hook
- npm.io page: https://npm.io/package/react-short-hook

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.1.1 (latest) — 2022-05-16
- 0.1.0 — 2022-05-16

## README

# react-short-hook

google authentication hooks for reset password only. **testing purpose**.

#Installation

```bash
# with npm
npm i react-short-hook

# with yarn
yarn add react-short-hook
```

- [usePassResetEmail](#usePassResetEmail)

## usePassResetEmail

### parameter:

- auth: Auth instance for the app

### returns:

- `sendPassResetEmail(email: string)` function to send the email.
- `loading` returns boolean that indicates processing state while sending the email.
- `error` returns error if any error occurs. usecase: `error.message` or `error.toast`
- `sent` returns boolean if the email has sent successfully without any error.

```js
// import package
import { usePassResetEmail } from 'react-short-hook';
```

```js
const [sendPassResetEmail, loading, error, sent] = usePassResetEmail(auth);
```

## example code

```js
function resetUserPassword() {
  const [sendPassResetEmail, loading, error, sent] = usePassResetEmail(auth);

  useEffect(() => {
    error && console.log(error.toast);
    sent && console.log('email sent successfully');
  }, [error, sent]);

  if (loading) return <p>sending in progress</p>;

  const emailRef = useRef();
  const handleResetPassword = () => {
    sendPassResetEmail(emailRef.current.value);
  };
  return (
    <div className="App">
      <input type="email" name="email" ref={emailRef} />
      <button onClick={handleResetPassword}>send</button>
    </div>
  );
}
```

---
_Source: https://npm.io/package/react-short-hook · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
