MCPcopy Create free account
hub / github.com/QuarkGluonPlasma/react-course-code / createDom

Function createDom

mini-react/src/mini-react.js:101–110  ·  view source on GitHub ↗
(fiber)

Source from the content-addressed store, hash-verified

99 }
100
101 function createDom(fiber) {
102 const dom =
103 fiber.type == "TEXT_ELEMENT"
104 ? document.createTextNode("")
105 : document.createElement(fiber.type)
106
107 updateDom(dom, {}, fiber.props)
108
109 return dom
110 }
111
112 const isEvent = key => key.startsWith("on")
113 const isProperty = key => key !== "children" && !isEvent(key)

Callers 1

updateHostComponentFunction · 0.85

Calls 1

updateDomFunction · 0.85

Tested by

no test coverage detected