How to use the react-reconciler/inline.dom.updateContainer function in react-reconciler

To help you get started, weโ€™ve selected a few react-reconciler examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github facebook / react / packages / react-dom / src / client / ReactDOMLegacy.js View on Github external
}
    // Initial mount should not be batched.
    unbatchedUpdates(() => {
      updateContainer(children, fiberRoot, parentComponent, callback);
    });
  } else {
    fiberRoot = root._internalRoot;
    if (typeof callback === 'function') {
      const originalCallback = callback;
      callback = function() {
        const instance = getPublicRootInstance(fiberRoot);
        originalCallback.call(instance);
      };
    }
    // Update
    updateContainer(children, fiberRoot, parentComponent, callback);
  }
  return getPublicRootInstance(fiberRoot);
}
github BUPTlhuanyu / ReactNote / react / packages / react-dom / src / client / ReactDOM.js View on Github external
ReactRoot.prototype.render = function(
  children: ReactNodeList,
  callback: ?() => mixed,
): Work {
  // ๅˆ›ๅปบReactWorkๅฏน่ฑกๅฎžไพ‹๏ผŒๅฐ†็ฌฌไธ‰ไธชๅ‚ๆ•ฐไผ ๅ…ฅ่ฟ™ไธชๅฎžไพ‹็š„_callbacksๅฑžๆ€งไธŠ๏ผŒๅœจcontainerๆ›ดๆ–ฐๆไบค้˜ถๆฎตๅฎŒๆˆไน‹ๅŽไพๆญคๆ‰ง่กŒๅ›ž่ฐƒ
  const root = this._internalRoot;
  const work = new ReactWork();
  callback = callback === undefined ? null : callback;
  if (__DEV__) {
    warnOnInvalidCallback(callback, 'render');
  }
  if (callback !== null) {
    work.then(callback);
  }
  //ๅผ€ๅง‹ๆž„ๅปบfiberๆ ‘๏ผŒchildrenๆ˜ฏReactDOM.render็š„็ฌฌไธ€ไธชๅ‚ๆ•ฐ๏ผŒrootๆ˜ฏ็ฌฌไบŒไธชๅ‚ๆ•ฐๅฏนๅบ”็š„FiberRoot๏ผŒwork._onCommitๆ˜ฏ็ฌฌไธ‰ไธชๅ‚ๆ•ฐๅ›ž่ฐƒๅ‡ฝๆ•ฐ็š„ๆ‰ง่กŒๅ™จ
  DOMRenderer.updateContainer(children, root, null, work._onCommit);
  //ๆœ€็ปˆ่ฟ”ๅ›žๅฎžไพ‹work
  return work;
};
ReactRoot.prototype.unmount = function(callback: ?() => mixed): Work {
github BUPTlhuanyu / ReactNote / react / packages / react-dom / src / client / ReactDOM.js View on Github external
ReactRoot.prototype.unmount = function(callback: ?() => mixed): Work {
  const root = this._internalRoot;
  const work = new ReactWork();
  callback = callback === undefined ? null : callback;
  if (__DEV__) {
    warnOnInvalidCallback(callback, 'render');
  }
  if (callback !== null) {
    work.then(callback);
  }
  DOMRenderer.updateContainer(null, root, null, work._onCommit);
  return work;
};
ReactRoot.prototype.legacy_renderSubtreeIntoContainer = function(
github BUPTlhuanyu / ReactNote / react / packages / react-dom / src / client / ReactDOM.js View on Github external
ReactRoot.prototype.legacy_renderSubtreeIntoContainer = function(
  parentComponent: ?React$Component,
  children: ReactNodeList,
  callback: ?() => mixed,
): Work {
  const root = this._internalRoot;
  const work = new ReactWork();
  callback = callback === undefined ? null : callback;
  if (__DEV__) {
    warnOnInvalidCallback(callback, 'render');
  }
  if (callback !== null) {
    work.then(callback);
  }
  DOMRenderer.updateContainer(children, root, parentComponent, work._onCommit);
  return work;
};
ReactRoot.prototype.createBatch = function(): Batch {
github facebook / react / packages / react-dom / src / client / ReactDOMLegacy.js View on Github external
unbatchedUpdates(() => {
      updateContainer(children, fiberRoot, parentComponent, callback);
    });
  } else {
github facebook / react / packages / react-dom / src / client / ReactDOMRoot.js View on Github external
ReactDOMRoot.prototype.unmount = ReactDOMBlockingRoot.prototype.unmount = function(
  callback: ?() => mixed,
): void {
  const root = this._internalRoot;
  const cb = callback === undefined ? null : callback;
  if (__DEV__) {
    warnOnInvalidCallback(cb, 'render');
  }
  const container = root.containerInfo;
  updateContainer(null, root, null, () => {
    unmarkContainerAsRoot(container);
    if (cb !== null) {
      cb();
    }
  });
};