fix: register CarPlayDashboard before dashboard connects#87
Merged
g4rb4g3 merged 1 commit intoMay 28, 2026
Merged
Conversation
Contributor
|
No significant issues found. |
Contributor
|
@claude please review |
|
Claude finished @SamuelBrucksch's task in 40s —— View job Review of PR #87
FeedbackNo issues found. The change is correct and well-scoped. The separation of |
SamuelBrucksch
approved these changes
May 28, 2026
Contributor
|
@g4rb4g3 do you have anything to add? If not I'll merge it. |
Contributor
|
Nope, looks reasonable. Thank you @LukasB-DEV ! |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
CarPlayDashboardis currently only registered with React Native'sAppRegistryafter the dashboard scene reportsdidConnect.That makes the dashboard root component registration depend on the CarPlay connection lifecycle. In some reload/reconnect flows, the native dashboard scene can request a React root view for the
CarPlayDashboardmodule before JS has received a freshdidConnectevent again.In that case React Native throws:
Reproduction
In a consuming app using
CarPlayDashboard.setComponent(...):CarPlayDashboardbefore JS registers the component again.Observed result:
Expected result:
CarPlayDashboardshould be registered once the JS component is provided viasetComponent(...). Native root view initialization should still only happen while the dashboard scene is connected.What Changed
CarPlayDashboardcomponent as soon assetComponent(...)has provided the component.HybridCarPlayDashboard.initRootView()guarded by the currentisConnectedstate.componentRegisteredguard so reconnects do not repeatedly callAppRegistry.registerComponent(...).Why
AppRegistry.registerComponent(...)is JS runtime setup and does not need an active CarPlay Dashboard connection.initRootView()is the part that needs the native dashboard scene/window to be connected, so that remains connection-gated.This keeps the existing native lifecycle behavior intact while making the JS module registration deterministic across reloads and reconnects.
Testing
CarPlayDashboardis registered before native dashboard root view initialization is requested.initRootView()when the dashboard is connected.