React native loading page

Hi, @ryantrem @bghgary
I need a solution for loading page on android with babylonjs react native.
I want to open my page more times. The first time I check this:

  useEffect(() => {
    if (engine) {
       SceneLoader.ImportMeshAsync(null, modelsUrl, glbFile, scene).then(result => {

The second time I check the:

    React.useCallback(() => {
        console.log('Screen was focused');
        if (engine) {
        return () => {
            console.log('Screen was unfocused');
    }, [])

But here’s a problem: engine is not always there immediately.
Is there a callback for react native?

1 Like

Where does engine come from in this case? I’ll need more context to provide guidance.