Skip to content

UReactBridgeReceiverComponent

Source: SampleProject/Plugins/UnrealReactBridge/Source/UnrealReactBridge/Public/ReactBridgeReceiverComponent.h

UActorComponent that listens for events sent from React (window.ue.bridge.send(EventName, payload)) and surfaces them to Blueprint via a multicast delegate. Drop it on any Actor that wants to react to UI input.

  • UCLASS: ClassGroup = ("Web HUD"), BlueprintSpawnableComponent
  • Display name: React Bridge Receiver
  • Add via: Components panel → Add → search "React Bridge Receiver"
  • Auto-registers with UUnrealReactBridgeSubsystem in BeginPlay, unregisters in EndPlay.

Properties

PropertyTypeCategoryNotes
EventNameFString (EditAnywhere, BlueprintReadWrite)React BridgeThe event name to subscribe to. Case-sensitive. Must match the React-side window.ue.bridge.send(EventName, ...) argument exactly.

Delegates

DelegateTypeCategoryWhen
OnReceivedFOnReactBridgeEvent (BlueprintAssignable)React BridgeFires with (JsonData : String) when a matching React-side send arrives

FOnReactBridgeEvent

cpp
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnReactBridgeEvent, const FString&, JsonData);

JsonData is the raw JSON string from event.detail. Parse it with JsonUtilities on the C++ side or with the BP utility nodes in /guide/receive-events.

Notes

  • No per-source filter in v1. The component fires for matches from any registered HUD layer. If two HUDs send the same EventName, both will trigger the delegate.
  • Stale components are skipped. The subsystem holds receivers as TWeakObjectPtr and skips destroyed entries during dispatch — you don't need to manually unbind in EndPlay.
  • No delivery ordering guarantees across receivers. Multiple receivers subscribed to the same EventName fire in registration order on the same frame; do not rely on a specific order across actors.

Example

text
ReactBridgeReceiver (component)
  EventName: "ui:reload:click"

Event On Received (JsonData : String)
  └─ Print String  "got reload: " + JsonData
cpp
// C++ equivalent
Receiver->EventName = TEXT("ui:reload:click");
Receiver->OnReceived.AddDynamic(this, &AMyActor::HandleReload);

void AMyActor::HandleReload(const FString& JsonData)
{
    UE_LOG(LogTemp, Log, TEXT("got reload: %s"), *JsonData);
}

TIP

For event names, the project convention is lowercase colon-separated namespacing (e.g. ui:reload:click, player:inventory:pick). React and UE both treat the string opaquely — pick a convention and stick to it.

See also

Released under the MIT License.