I have often run into situations where a child component simply refuses to update.
It can be incredibly frustrating when you know the underlying data has changed, but the UI remains stuck in the old state.
Ideally, React handles re-rendering automatically when props or state change, but real-world development often throws us curveballs.
In this tutorial, I will show you exactly how to force a child component to re-render using the same methods I use in production environments.
Why React Components Don’t Re-render
Before we jump into the “how,” it is important to understand that React relies on “shallow comparison” to decide if an update is needed.
If you are mutating an object or an array directly, React might think the data is the same and skip the render cycle entirely.
Over the years, I have found that most “stuck” components are the result of non-primitive data types not being handled immutably.
However, sometimes you are dealing with third-party libraries or legacy code where you just need to trigger that update manually.
Method 1: Use the ‘key’ Prop (The Best Way)
This is my go-to method because it is clean, declarative, and leverages React’s built-in reconciliation algorithm.
When you change the key of a component, React treats it as a brand-new component, unmounting the old one and mounting a new one.
Let’s look at a real-world example involving a US Real Estate Listing where we need to reset a “Mortgage Calculator” child component.
import React, { useState } from 'react';
// Child Component: Mortgage Calculator
const MortgageCalculator = ({ housePrice }) => {
console.log("Mortgage Calculator Rendered");
return (
<div style={{ padding: '20px', border: '1px solid #ccc', marginTop: '10px' }}>
<h3>Mortgage Estimator (USA)</h3>
<p>Current Property Value: ${housePrice.toLocaleString()}</p>
<input type="number" placeholder="Enter Down Payment" />
<p><small>Note: This component resets when the key changes.</small></p>
</div>
);
};
// Parent Component: Property Manager
export default function PropertyManager() {
const [price, setPrice] = useState(450000);
const [resetCounter, setResetCounter] = useState(0);
const updatePrice = () => {
// Simulating a price update for a listing in Austin, Texas
setPrice(prev => prev + 10000);
};
const forceReset = () => {
// Incrementing the counter forces a re-render of the child
setResetCounter(prev => prev + 1);
};
return (
<div style={{ padding: '40px' }}>
<h2>Texas Real Estate Dashboard</h2>
<button onClick={updatePrice}>Increase Listing Price</button>
<button onClick={forceReset} style={{ marginLeft: '10px' }}>
Force Reset Calculator
</button>
{/* Using the resetCounter as a key forces a full re-render */}
<MortgageCalculator
key={resetCounter}
housePrice={price}
/>
</div>
);
}You can refer to the screenshot below to see the output.

By changing the key value, you tell React that the MortgageCalculator is no longer the same entity, forcing a complete refresh of its internal state.
Method 2: Force Update via State Lifting
I often use this method when the child component needs to react to a specific action taken in the parent component.
Instead of trying to “force” the child from the outside, you simply pass a piece of state down as a prop.
In this example, we’ll track New York Stock Exchange (NYSE) ticker updates.
import React, { useState, useEffect } from 'react';
// Child Component: Ticker Display
const StockTicker = ({ symbol, lastUpdated }) => {
const [price, setPrice] = useState(0);
useEffect(() => {
// Simulating fetching a new stock price whenever lastUpdated changes
const newPrice = (Math.random() * 1000).toFixed(2);
setPrice(newPrice);
console.log(`Updated price for ${symbol}`);
}, [lastUpdated, symbol]);
return (
<div style={{ background: '#f4f4f4', padding: '15px', borderRadius: '8px' }}>
<h4>Symbol: {symbol}</h4>
<p>Market Price: ${price}</p>
<p><small>Last Sync: {lastUpdated}</small></p>
</div>
);
};
// Parent Component: Market Monitor
export default function MarketMonitor() {
const [syncTime, setSyncTime] = useState(new Date().toLocaleTimeString());
const handleRefresh = () => {
setSyncTime(new Date().toLocaleTimeString());
};
return (
<div style={{ padding: '30px' }}>
<h1>Wall Street Market Monitor</h1>
<button onClick={handleRefresh}>Manual Market Sync</button>
<hr />
<StockTicker symbol="AAPL" lastUpdated={syncTime} />
<br />
<StockTicker symbol="TSLA" lastUpdated={syncTime} />
</div>
);
}You can refer to the screenshot below to see the output.

Whenever you click the “Manual Market Sync” button, the syncTime state changes, which triggers the useEffect inside the child.
Method 3: Use a Force Update Hook (The “Emergency” Way)
In some rare cases, you might not have a specific prop to change, but you still need the component to refresh.
In the old class-component days, we had this.forceUpdate(). In functional components, we can recreate this using a simple toggle.
I typically use this when dealing with US Census Data or large datasets that are stored in a global variable or ref.
import React, { useState, useCallback } from 'react';
// Custom Hook to mimic forceUpdate
function useForceUpdate() {
const [, setValue] = useState(0);
return () => setValue(value => value + 1);
}
// Child Component
const CensusReport = () => {
// Assume this data is coming from a global window object or external source
const populationData = window.currentCensusData || "No data loaded";
return (
<div style={{ padding: '20px', backgroundColor: '#eef2f3' }}>
<h3>US Census Bureau QuickFacts</h3>
<p>Status: {populationData}</p>
<p>Timestamp: {new Date().getTime()}</p>
</div>
);
};
// Parent Component
export default function DataDashboard() {
const forceUpdate = useForceUpdate();
const loadNewData = () => {
// Simulating an external data mutation
window.currentCensusData = "New York Population: 8.4 Million";
forceUpdate(); // Triggers the re-render manually
};
return (
<div style={{ padding: '40px' }}>
<h2>Federal Data Portal</h2>
<button onClick={loadNewData}>Fetch Latest Census Data</button>
<div style={{ marginTop: '20px' }}>
<CensusReport />
</div>
</div>
);
}You can refer to the screenshot below to see the output.

While this works, I recommend using this sparingly as it bypasses the standard React data flow.
Method 4: Pass a Function to Update Child State
Sometimes you want the parent to tell the child to re-render its own internal state without affecting other props.
In this scenario, we can use a US Healthcare Provider search example where the results need to be cleared from the parent.
import React, { useState } from 'react';
// Child Component
const ProviderSearch = ({ triggerClear }) => {
const [query, setQuery] = useState("");
// This is a simple way to respond to parent actions
React.useEffect(() => {
if (triggerClear > 0) {
setQuery("");
}
}, [triggerClear]);
return (
<div>
<label>Search Doctors in California: </label>
<input
value={query}
onChange={(e) => setQuery(e.target.value)}
placeholder="Enter Zip Code..."
/>
</div>
);
};
// Parent Component
export default function HealthApp() {
const [clearCount, setClearCount] = useState(0);
return (
<div style={{ padding: '30px' }}>
<h2>BlueCross Provider Portal</h2>
<ProviderSearch triggerClear={clearCount} />
<br />
<button onClick={() => setClearCount(c => c + 1)}>
Clear All Search Filters
</button>
</div>
);
}This is very effective for forms and search bars where the parent needs to “reset” the child.
Method 5: Use useImperativeHandle
This is an advanced technique I use when I need to expose a specific “refresh” function from the child to the parent.
This is perfect for a US Postal Service (USPS) Tracking component that needs to be refreshed on demand.
import React, { useState, useImperativeHandle, forwardRef } from 'react';
// Child Component wrapped in forwardRef
const TrackingStatus = forwardRef((props, ref) => {
const [status, setStatus] = useState("Package Picked Up - Chicago, IL");
useImperativeHandle(ref, () => ({
refreshStatus() {
// Simulate an API call update
setStatus("In Transit - Arrival at Sort Facility, Denver, CO");
}
}));
return (
<div style={{ borderLeft: '4px solid #004b87', paddingLeft: '15px' }}>
<strong>Status: </strong> {status}
</div>
);
});
// Parent Component
export default function ShipmentTracker() {
const trackingRef = React.useRef();
return (
<div style={{ padding: '40px' }}>
<h3>USPS Tracking System</h3>
<p>Tracking Number: 9400 1000 0000 0000 0000 00</p>
<TrackingStatus ref={trackingRef} />
<br />
<button onClick={() => trackingRef.current.refreshStatus()}>
Check for Updates
</button>
</div>
);
}Using useImperativeHandle gives you fine-grained control over the child’s behavior from the parent component.
Important Considerations
While these methods are powerful, I always advise developers to check their data structures first.
Most re-rendering issues in React are caused by mutating state instead of creating new copies of objects.
Always ensure you are using the spread operator (…) or tools like Immer when updating state.
Forcing a re-render should be your last resort when standard prop updates aren’t feasible.
In this tutorial, I have covered several ways to force a child component to re-render in React.
I personally find the key prop method to be the most “React-way” of handling this, but the other methods are equally valid depending on your specific use case.
You may also like to read:
- React Router DOM Route Component
- Best React Mobile Component Libraries
- How to Trigger Function in Child Component in React
- Best Tailwind React Component Library

I am Bijay Kumar, a Microsoft MVP in SharePoint. Apart from SharePoint, I started working on Python, Machine learning, and artificial intelligence for the last 5 years. During this time I got expertise in various Python libraries also like Tkinter, Pandas, NumPy, Turtle, Django, Matplotlib, Tensorflow, Scipy, Scikit-Learn, etc… for various clients in the United States, Canada, the United Kingdom, Australia, New Zealand, etc. Check out my profile.