-
-
Save ShopifyEng/7cf24489f098ed973f1ae0f270bc2634 to your computer and use it in GitHub Desktop.
Remote Rendering: Shopify’s Take on Extensible UI - Basic example setting up a `RemoteReceiver` to work together with a `RemoteRoot`
This file contains 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
// Extension | |
import { createEndpoint } from "@remote-ui/rpc"; | |
import { createRemoteRoot } from "@remote-ui/core"; | |
function render(remoteChannel) { | |
const root = createRemoteRoot(remoteChannel); | |
root.appendChild(root.createText("Hello World!")); | |
root.appendChild(root.createComponent("LineBreak")); | |
root.mount(); | |
} | |
createEndpoint(self).expose({ render }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment