zenozeng/p5.js-svg

use library within react, eg with react-p5

amcc opened this issue · 1 comments

amcc commented

I would like to use this library in react, up to now i've been using react-p5 and am trying to understand the best way of getting SVG output to work.

I have tried importing p5.js-svg via a script in the head, but this isn't working (not surprisingly I suppose as webpack is bundling everything else in my React (GatsbyJS) application.

If you have any insight into the best way to do this i hope someone can help

@amcc

Hi, I just added an example using vite here: https://github.com/zenozeng/p5.js-svg/blob/main/examples/vite/src/main.ts

If the issue is not resolved, feel free to reopen it.