简体   繁体   中英

Rendering a Component in React.js

I have a Small Query, I tried to google it but couldn't find the solution.

When a React Component state is changed(useState()), so the whole page is rendered or that specific React Component is rendered like in Ajax?

Only the component will be rendered again.

The useState will render all the components associated with it, meaning if you put the useState in the parent component it will also re-render the children component.

When State changes in the child component do not affect the parent component, but when a parent component's state changes, all child components are rendered.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM