DEV Community

Discussion on: How to Force Re-Render a React Component & Should you do it?

Collapse
 
ruppysuppy profile image
Tapajyoti Bose • Edited

That's exactly what I pointed out: React re-renders a component when the state data changes. If the props contains a state data from the parent component, a re-rendered is triggered for it too, else it fails to re-render. The fix for it is provided above too & there is no need to force a re-render

Try out the code provided in the example to see for yourself