# react-cookie-clicker

> > Click cookie and be rewarded with more cookies! 🎉

Latest version **0.0.5** (published 2022-01-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-cookie-clicker
pnpm add react-cookie-clicker
yarn add react-cookie-clicker
bun add react-cookie-clicker
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2022-01-31 |
| First published | 2022-01-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 1.7 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Ian McPhail |
| Maintainers | devchampian |

## Links

- npm: https://www.npmjs.com/package/react-cookie-clicker
- npm.io page: https://npm.io/package/react-cookie-clicker

## Dependencies (5)

- [react](https://npm.io/package/react.md) ^17.0.2
- [react-dom](https://npm.io/package/react-dom.md) ^17.0.2
- [prop-types](https://npm.io/package/prop-types.md) ^15.5.4
- [react-rewards](https://npm.io/package/react-rewards.md) ^1.1.2
- [react-hot-loader](https://npm.io/package/react-hot-loader.md) ^4.13.0

## Recent versions

- 0.0.5 (latest) — 2022-01-31
- 0.0.4 — 2022-01-24
- 0.0.3 — 2022-01-24
- 0.0.2 — 2022-01-24

## README

# React Cookie Clicker 🍪

> Click cookie and be rewarded with more cookies! 🎉

# Installation

Install the package while inside your project directory with the following:

```properties
npm install react-cookie-clicker

// OR

yarn add react-cookie-clicker
```

## Usage

```jsx
import CookieClicker from 'react-cookie-clicker';

export default function App() {
  return (
    <>
      <CookieClicker />
      <p>Click the cookie!</p>
    <>
  );
}
```

### SSR with Next.js
This package only works in the browser and does not currently support server-side rendering (SSR). If you want to use it in a Next.js application, which prefetches dynamic content by default, use their [dynamic import functionality without SSR](https://nextjs.org/docs/advanced-features/dynamic-import#with-no-ssr).

```jsx
import dynamic from 'next/dynamic';
const CookieClicker = dynamic(() => import('react-cookie-clicker'), {
  ssr: false
});

const App = () => {
  return (
    <div style={{ marginTop: 150 }}>
      <CookieClicker />
      <h2>Click the cookie</h2>
    </div>
  );
};

export default App;
```

## Props

The `CookieClicker` component accepts the following props:

| Name         | Type   | Description                                                                               |
| ------------ | ------ | ----------------------------------------------------------------------------------------- |
| count        | number | Controls the number of rewarded cookies (default: `20`)                                   |
| onClick      | func   | Optional callback function fired upon clicking button                                     |
| rewardConfig | object | Configuration options for [react-rewards](https://github.com/thedevelobear/react-rewards) |

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