Skip to content

Instantly share code, notes, and snippets.

@ShopifyEng
Created November 30, 2021 20:37
Show Gist options
  • Save ShopifyEng/eaf768e0edc945ecc2a509fffa63064a to your computer and use it in GitHub Desktop.
Save ShopifyEng/eaf768e0edc945ecc2a509fffa63064a to your computer and use it in GitHub Desktop.
Remote Rendering: Shopify’s Take on Extensible UI - Using a `DomReceiver` to map remote components to native DOM elements
import { DomReceiver, withEventListeners } from "@remote-ui/dom";
// ...
const receiver = new DomReceiver({
bind: document.getElementById("container"),
customElement: {
Button: "button",
LineBreak: "br"
},
applyProperty: withEventListeners
});
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment