--Akim Demaille
React apps are organized as a series of nested components. These components are functional in nature: that is, they receive information through arguments (represented in the props attribute) and pass information via their return values (the return value of the render function). This is called unidirectional data flow. Data is passed down from components to their children.
-- Manoj Kumar 😜
console.log("EXECUTION START");
function helloworld(){
var greeting = "Hello World"
console.log(greeting);
}
helloworld();
setTimeout(2000,()=>{
console.log("EXECUTION END")
})
START
helloworld
END
greeting-scope-start
greeting-scope-end
Element-1
Element-2
Element-3
As virtual DOM has an algorithm to diff the tree,
so question is
{
"type": "h1",
"key": null,
"ref": null,
"props": { "children": ["Hello ", "React", "!"] },
"_owner": null,
"_store": {}
}
{
"type": "div",
"key": null,
"ref": null,
"props": {
"children": [
{
"type": "button",
"key": null,
"ref": null,
"props": { "children": "Update" },
"_owner": null,
"_store": {}
},
{
"type": "div",
"key": null,
"ref": null,
"props": { "className": "friend-list" },
"_owner": null,
"_store": {}
}
]
},
"_owner": null,
"_store": {}
}