Skip to content

Instantly share code, notes, and snippets.

View RenderWrapper.jsx
import { render } from "react";
import MyWidget from "./components/mywidget.jsx";
window.MyWidgetRenderer = function(node, props) {
render(<MyWidget {...props} />, node);
};
@BjoernRuberg
BjoernRuberg / ComponentLoader.jsx
Last active Dec 2, 2017
Code example for a component that loads another react component from external servers
View ComponentLoader.jsx
import {Component} from "react";
var CrossCustomEvent = require('customevent');
var scriptLoader = require("load-script");
module.exports = function(identifier) {
/* Customers pass some kind of identifier to this function.
* It might be a user name or an access key.
* Something that identifies the location of the script code of this customer
*/
class Wrapper extends Component {