
[Related topic recommendations:react interview questions(2020)]
key is used in React to
trackwhich elements in the list have beenmodified,deletedoradded'sauxiliary identifier. Indiff algorithm, key is used todeterminewhether the element node has been moved or a newly created element, reducingunnecessaryelementsduplication Render.

What's the difference?

because
this. The updates of propsandthis.statemay beasynchronous, and their values cannot be relied upon to calculate the next state

This function will be called when the setState function call is completed and the component starts to re-render. , we can use this function to monitor whether rendering is completed
constructorIn super() Subclasses cannot use this before being called. In ES5, subclasses must call super() in the constructor. The reason for passing props to super() is to facilitate (in subclasses) the idea of accessing
9.flux inthis.props
The biggest feature of Flux is the "one-way flow" of data.
Process:
User accessviewviewSend the user’sactiondispatcherReceiveactionand requirestoreto make corresponding updatesstoreAfter the update, send achangeeventviewAfter receiving thechangeevent, update the page.


For more programming related content, please pay attention to php Chinese websiteIntroduction to ProgrammingColumn!
The above is the detailed content of React basic interview questions (share). For more information, please follow other related articles on the PHP Chinese website!
What to do if the embedded image is not displayed completely
Why do all the icons in the lower right corner of win10 show up?
Introduction to the usage of rowid in oracle
The role of c++this pointer
What are the differences between weblogic and tomcat
The difference and connection between java and javascript
How to use rank function
what is index