Skip to content

React Bridge library

Source: SampleProject/Plugins/UnrealReactBridge/Source/UnrealReactBridge/Public/ReactBridgeLibrary.h · Private/ReactBridgeLibrary.cpp

Mounting a HUD no longer goes through this library

The six Web HUD nodes that used to live here (Add Web HUD, Remove Web HUD, Remove Web HUD By Name, Remove All Web HUDs, Is Web HUD Active, Set Web HUD Visible) are gone, along with the anchor/handle types they used. Mounting a HUD is now just dragging a React Web Browser widget into a Widget Blueprint — see /guide/first-hud and the UReactWebBrowser reference.

UReactBridgeLibrary is a BlueprintFunctionLibrary static, callable from any Blueprint (Level BP, Player Controller, Game Mode, Widget BP, etc.), under the React Bridge category.

Get Plugin File URL

cpp
static FString GetPluginFileURL(FName PluginName, const FString& RelativePath);

BlueprintPure — safe to call from arbitrary expressions.

ParamTypeRequiredNotes
PluginNameNameyesName as it appears in the .uplugin, e.g. UnrealReactBridge
RelativePathStringyesPath beneath the plugin root, e.g. Resources/WebDemo/index.html

Returns — A file:// URL for that file, resolved through the plugin registry at runtime. Empty string if no plugin by that name is installed.

Why it's in C++ — Blueprint has no way to ask where a plugin is installed (IPluginManager has no Blueprint bindings). Which file you want stays on the graph as two literal strings, so the call site reads for itself.

It also handles the one cross-platform wrinkle: Windows paths start with a drive letter and need three slashes (file:///C:/…), POSIX paths already start with one (file:///Users/…).

Use it for — pointing a ReactWebBrowser at HTML that ships inside a plugin: the bundled demos, or your own plugin-hosted React build.

Packaging

A plugin's non-code files reach a packaged build only if Config/FilterPlugin.ini lists them. A URL built for a file that was never filtered in resolves to a path that does not exist at runtime, and the browser simply shows nothing. This plugin's FilterPlugin.ini ships Resources/WebDemo-MultiHUD/ — the Resources/WebDemo/ smoke test is Editor-only by design.

Example

text
Event BeginPlay
  └─ Get Plugin File URL (PluginName = UnrealReactBridge,
                          RelativePath = Resources/WebDemo/index.html) → Url
        └─ ReactWebBrowser.LoadReactURL(Url)

See also

Released under the MIT License.