I really like p5.js and react.js so i wondered how to combine these two together, and i was unable to do it so I need your help. I cant really provide you with some code sa
react-p5
This Component lets you integrate p5 Sketches into your React App. DEMO, Documentation
Installation
npm i react-p5
Usage
import React, { Component } from "react";
import Sketch from "react-p5";
export default class App extends Component {
x = 50
y = 50
setup = (p5, parent) => {
p5.createCanvas(500, 500).parent(parent)
}
draw = p5 => {
p5.background(0)
p5.ellipse(this.x, this.y, 70, 70)
this.x++
}
render() {
return
}
}