React (create-react-app) PlayCanvas Integration

I am trying to integrate PlayCanvas with my React components. I was wondering if someone could guide me to the right direction in terms of rendering the sample cube in PlayCanvas’ github page.

Is it as simple as creating a class and copy and pasting the sample code? I have tried that with multiple revisions but still get errors. I think my main problem is that create-react-app is not recognizing the PlayCanvas engine. I brought in the engine through a html script. Would I have to call a fetch function instead?

2 Likes

Did not have much experience with React or JS, but all you have to do is paste the sample code in your index.html…