Skip to content

importing p5.dom.js in React #74

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
johnneuland opened this issue Jan 30, 2021 · 1 comment
Closed

importing p5.dom.js in React #74

johnneuland opened this issue Jan 30, 2021 · 1 comment

Comments

@johnneuland
Copy link

  p5.setup = function() {
    video = p5.createCapture(p5.VIDEO);}

To use this code, I need to import an addon. I tried both ways of importing:

import "react-p5-wrapper/node_modules/p5/lib/addons/p5.dom";
import "p5/lib/addons/p5.dom";

but I get an error that:

Can't resolve 'p5/lib/addons/p5.dom' in '/home/new/src/pages/myPage'

My package.json file has this:

    "react-dom": "^17.0.1",
    "react-p5": "^1.3.6",
    "react-p5-wrapper": "^2.3.0",
@jamesrweb
Copy link
Collaborator

jamesrweb commented Mar 14, 2021

Please follow the guidance in my comment on #61. I would also advise updating to the latet version I just released (2.4.0) which resolves #39.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants