But I’m needing to control when the playcanvas app goes into loading mode inside REACTJS, is there a way to listen for that?
Do you want to know when the PlayCanvas app has finished loading or progress or something similar? Is the PlayCanvas app in an iframe?
Yes, I want to know when the playcanvas application has finished loading.
No, it is not inside an iframe, insert the code that you download directly inside REACT, I am controlling it through the “start.js” file that I generated.
A couple of ways to do this:
Modify __start__.js
where it calls app.start()
and also notify something in your app
After the PlayCanvas app has started loading, get a reference to the application object and listen for the start event.
eg
pc.Application.getApplication().once('start', () => {/*do something*/});
See lifecycle here: Application Lifecycle | Learn PlayCanvas