Created
December 14, 2021 20:09
-
-
Save nirkaufman/7181238a8328bcb108115d381e6c76f1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| import Reconciler from "react-reconciler"; | |
| const hostConfig = { | |
| supportsMutation: true, | |
| supportsPersistence: false, | |
| noTimeout: -1, | |
| isPrimaryRenderer: true, | |
| supportsHydration: false, | |
| createInstance(type, props, rootContainer, hostContext, internalHandle) { | |
| return null; | |
| }, | |
| createTextInstance(text, rootContainer, hostContext, internalHandle) { | |
| return null; | |
| }, | |
| appendInitialChild(parentInstance, child) {}, | |
| finalizeInitialChildren(instance, type, props, rootContainer, hostContext) { | |
| return false; | |
| }, | |
| prepareUpdate(instance, type, oldProps, newProps, rootContainer, hostContext) {}, | |
| shouldSetTextContent(type, props) { | |
| return false; | |
| }, | |
| getRootHostContext(rootContainer) { | |
| return null; | |
| }, | |
| getChildHostContext(parentHostContext, type, rootContainer) { | |
| return null; | |
| }, | |
| getPublicInstance(instance) { | |
| return null; | |
| }, | |
| prepareForCommit(containerInfo) { | |
| return null; | |
| }, | |
| resetAfterCommit(containerInfo) {}, | |
| preparePortalMount(containerInfo) {}, | |
| now() { | |
| return 0; | |
| }, | |
| scheduleTimeout(fn, delay) {}, | |
| cancelTimeout(id) {}, | |
| appendChild(parentInstance, child) {}, | |
| appendChildToContainer(container, child) {}, | |
| insertBefore(parentInstance, child, beforeChild) {}, | |
| insertInContainerBefore(container, child, beforeChild) {}, | |
| removeChild(parentInstance, child) {}, | |
| removeChildFromContainer(container, child) {}, | |
| resetTextContent(instance) {}, | |
| commitTextUpdate(textInstance, oldText, newText) {}, | |
| commitMount(instance, type, props, internalInstanceHandle) {}, | |
| commitUpdate(instance, updatePayload, type, prevProps, nextProps, internalHandle) {}, | |
| hideInstance(instance) {}, | |
| hideTextInstance(textInstance) {}, | |
| unhideInstance(instance, props) {}, | |
| unhideTextInstance(textInstance, text) {}, | |
| clearContainer(container) {}, | |
| } | |
| const reconciler = Reconciler(hostConfig); | |
| export const Renderer = { | |
| render(component, container) { | |
| const root = reconciler.createContainer(container, 0, false, null); | |
| reconciler.updateContainer(component, root, null); | |
| }, | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment