Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "[Fabric] call reportMount to implement UIManagerMountHook support",
"packageName": "react-native-windows",
"email": "30809111+acoates-ms@users.noreply.github.com",
"dependentChangeType": "patch"
}
12 changes: 11 additions & 1 deletion vnext/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,17 @@ void FabricUIManager::constraintSurfaceLayout(
m_surfaceManager->constraintSurfaceLayout(surfaceId, layoutConstraints, layoutContext);
}

void FabricUIManager::didMountComponentsWithRootTag(facebook::react::SurfaceId surfaceId) noexcept {}
winrt::Microsoft::ReactNative::ReactNotificationId<facebook::react::SurfaceId>
FabricUIManager::NotifyMountedId() noexcept {
return {L"ReactNative.Fabric", L"Mounted"};
}

void FabricUIManager::didMountComponentsWithRootTag(facebook::react::SurfaceId surfaceId) noexcept {
m_context.UIDispatcher().Post([context = m_context, self = shared_from_this(), surfaceId]() {
self->m_scheduler->reportMount(surfaceId);
context.Notifications().SendNotification(NotifyMountedId(), surfaceId);
});
}

void FabricUIManager::RCTPerformMountInstructions(
facebook::react::ShadowViewMutationList const &mutations,
Expand Down
2 changes: 2 additions & 0 deletions vnext/Microsoft.ReactNative/Fabric/FabricUIManagerModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ struct FabricUIManager final : public std::enable_shared_from_this<FabricUIManag
winrt::Microsoft::ReactNative::ReactNativeIsland GetReactNativeIsland(
facebook::react::SurfaceId surfaceId) const noexcept;

static winrt::Microsoft::ReactNative::ReactNotificationId<facebook::react::SurfaceId> NotifyMountedId() noexcept;

private:
void installFabricUIManager() noexcept;
void initiateTransaction(facebook::react::MountingCoordinator::Shared mountingCoordinator);
Expand Down