Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ManasJayanth/0c6bd034227d5204f33e80d1ce13e11e to your computer and use it in GitHub Desktop.
Save ManasJayanth/0c6bd034227d5204f33e80d1ce13e11e to your computer and use it in GitHub Desktop.
Snippets for Learn you some custom react renderers
import ReactReconciler from 'react-reconciler';
const hostConfig = {};
const DOMRenderer = ReactReconciler(hostConfig);
let internalContainerStructure;
export default {
render(elements, containerNode, callback) {
// We must do this only once
if (!internalContainerStructure) {
internalContainerStructure = DOMRenderer.createContainer(
containerNode,
false,
false
);
}
DOMRenderer.updateContainer(elements, internalContainerStructure, null, callback);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment