What happens when you call setState?

Technology CommunityCategory: ReactWhat happens when you call setState?
VietMX Staff asked 3 years ago

The state property is updated in a React component with the object passed into setState, and this is done asynchronously. It tells React that this component and its children need to be re-rendered, but React may not do this immediately (it may batch these state update requests for better performance).