Created
August 22, 2019 10:53
-
-
Save Tevinthuku/e16770b4a09f67c0a6a2e982f8c11fe5 to your computer and use it in GitHub Desktop.
This file contains 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
//NB: ALL DOM nodes have their corresponding fibers in our new implementation | |
// most of this properties will make sense once we begin using them | |
let fiber = { | |
tag: HOST_COMPONENT, // we can have either host of class component | |
type: "input", | |
parent: parentFiber, // the parentNode’s fiber | |
child: childFiber, // the childNode’s fiber if it has any | |
sibling: null, // the element that is in the same tree level as this input | |
alternate: currentFiber, // the fiber that has been rendered on the dom. Will be null if its on initial render | |
stateNode: document.createElement(“div”), | |
props: { children: [], id: "image", type: "text"}, | |
effectTag: PLACEMENT,// can either be PLACEMENT | DELETION | UPDATe depending on the dom operation to be done | |
effects: [] // this array will contain fibers of its childComponent | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment