Skip to content

Conversation

@pfeiffer
Copy link
Contributor

Summary

Fixes a potential calling of window.nativeBridge to register Strada components before the bridge is actually initialized.

In the Strada initialization script, we have the following snippet to initialize the bridge:

function initializeBridge() {
    window.nativeBridge = new NativeBridge();
}

This method is called dependent on the document.readyState or on DOMContentLoaded.

This means that window.nativeBridge could be undefined when we register the components of the Strada bridge from the React Native side.

This PR changes so that we register the available components at the same time as we initialize the bridge, making sure that the window.nativeBridge is available when we call that.

Test plan

Run app with Strada components, confirm that they work.

Fixes a potential calling of `window.nativeBridge` to register Strada
components before the bridge is actually initialized.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant