Element VS Component

 

Element represents the description of a DOM node, then Eelment should be a virtual DOM, similar to the VNode of vue.js

React.createElement(tag, data, children)

 

Comopnent is a class/function that has certain inputs (props, but also internal state) and outputs (React Element, through render)

 

Through the DIFF algorithm, compare the old and new Element, and perform the update of the DOM node

 

https://tylermcginnis.com/react-elements-vs-react-components/

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326213198&siteId=291194637