Skip to content

Commit

Permalink
二: 1.创建 ReactDOM.render
Browse files Browse the repository at this point in the history
  • Loading branch information
zh-lx committed Nov 9, 2021
1 parent 2fbbb63 commit a844706
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/mini-react/react-dom.js
@@ -0,0 +1,12 @@
function render(element, container) {
const dom = renderDom(element);
container.appendChild(dom);
}

// 将 React.Element 渲染为真实 dom
function renderDom(element) {}

const ReactDOM = {
render,
};
export default ReactDOM;

0 comments on commit a844706

Please sign in to comment.