# p5-react

> P5 wrapper for React.js application

Latest version **1.0.3** (published 2023-08-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install p5-react
pnpm add p5-react
yarn add p5-react
bun add p5-react
```

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2023-08-01 |
| First published | 2023-05-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | DemonHa |
| Maintainers | demonha |

## Links

- npm: https://www.npmjs.com/package/p5-react
- Repository: https://github.com/DemonHa/p5-react
- Homepage: https://github.com/DemonHa/p5-react#readme
- Issues: https://github.com/DemonHa/p5-react/issues
- npm.io page: https://npm.io/package/p5-react

## Dependencies (1)

- [p5](https://npm.io/package/p5.md) ^1.6.0

## Recent versions

- 1.0.3 (latest) — 2023-08-01
- 1.0.2 — 2023-06-13
- 1.0.1 — 2023-05-31

## README

# p5-react

P5 wrapper for React.js application

[![NPM Version](https://img.shields.io/npm/v/p5-react.svg?style=flat)]()
[![NPM License](https://img.shields.io/npm/l/all-contributors.svg?style=flat)](https://github.com/DemonHa/p5-react/blob/main/LICENSE)
[![npm downloads](https://img.shields.io/npm/dt/p5-react.svg)](https://www.npmjs.com/package/p5-react)
![example workflow](https://github.com/DemonHa/p5-react/actions/workflows/test.yml/badge.svg)

# Installation

For npm users:

```
npm i p5-react
```

For yarn users:

```
yarn add p5-react
```

# Quick Start

```typescript
import P5 from "p5";
import Sketch from "p5-react";

const setup = (p5: P5, canvasRef: HTMLDivElement) => {
  p5.createCanvas(500, 500).parent(canvasRef);
};

const sketch = (p5: P5) => {
  p5.draw = () => {
    // Draw
  };
};

const App = () => {
  return <Sketch setup={setup} sketch={sketch} />;
};

export default App;
```

Note: You can access p5 globally from other modules

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