Sketch with classes implementation in a Reactjs project

Given p5js isn’t a JS module, but instead it is distributed as a normal JS file, I don’t think we can use the JS keyword import for it. :confused:

If you make a class that needs to request a specific object reference many times, it’s much simpler to request that from its constructor and store it as 1 of its properties. :bulb:

In the sketch link below, the class Ball asks for a p5 object as its constructor’s parameter; then stores it as property p: :nerd_face:

1 Like