When I change the data file where I have stored my array of data, component where that data is being displayed doesn't change. I have tried to filter the original data and get only the selected values and it worked well but the display hasn't changed even after the data was changed.
Here are the code of key components and a screenshot 
Single item component:
function Item() {
let [data, setData] = useContext(DataContext);
let Array = data.map((item) => {
return (
<div className="Item">
<img src={item.url} />
<h1>{item.name}</h1>
<p>{item.desc}</p>
<h2>{item.price}</h2>
<Link to={`/product/${item.path}`}>
<h3>See details</h3>
</Link>
</div>
);
});
return <>{Array}</>;
}
Data component:
export let DataContext = createContext();
export let DataProvider = (props) => {
let [data, setData] = useState([
{
name: "Toshiba",
desc: "Laptop copmuter",
price: 299,
url:
"https://images.pexels.com/photos/3975677/pexels-photo-3975677.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940",
path: "Toshiba",
type: "laptop",
details:
"Some words just to fill this space Some words just to fill this space Some words just to fill this space Some words just to fill this space Some words just to fill this space Some words just to fill this space Some words just to fill this space Some words just to fill this space",
},
{
name: "Lenovo",
desc: "Laptop copmuter",
price: 399,
url:
"https://images.pexels.com/photos/3975677/pexels-photo-3975677.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940",
path: "Lenovo",
type: "laptop",
details:
"Some words just to fill this space Some words just to fill this space Some words just to fill this space Some words just to fill this spaceSome words just to fill this space Some words just to fill this space Some words just to fill this space Some words just to fill this space",
},
{
name: "Asus",
desc: "Laptop copmuter",
price: 199,
url:
"https://images.pexels.com/photos/3975677/pexels-photo-3975677.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940",
path: "Asus",
type: "laptop",
details:
"Some words just to fill this space Some words just to fill this space Some words just to fill this space Some words just to fill this space Some words just to fill this space Some words just to fill this space Some words just to fill this space Some words just to fill this space",
},
{
name: "HP",
desc: "Laptop copmuter",
price: 299,
type: "laptop",
url:
"https://images.pexels.com/photos/3975677/pexels-photo-3975677.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940",
path: "HP",
details:
"Some words just to fill this space Some words just to fill this space Some words just to fill this space Some words just to fill this space Some words just to fill this space Some words just to fill this space Some words just to fill this space Some words just to fill this space Some words just to fill this space Some words just to fill this space ",
},
{
name: "Apple",
desc: "Laptop copmuter",
price: 299,
type: "laptop",
url:
"https://images.pexels.com/photos/3975677/pexels-photo-3975677.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940",
path: "Apple",
details:
"Some words just to fill this space Some words just to fill this space Some words just to fill this space Some words just to fill this spaceSome words just to fill this space Some words just to fill this space Some words just to fill this space Some words just to fill this space",
},
{
name: "Apple",
desc: "Android",
price: 299,
type: "mobile",
url:
"https://images.pexels.com/photos/3975677/pexels-photo-3975677.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940",
path: "Apple",
details:
"Some words just to fill this space Some words just to fill this space Some words just to fill this space Some words just to fill this spaceSome words just to fill this space Some words just to fill this space Some words just to fill this space Some words just to fill this space",
},
]);
return (
<DataContext.Provider value={[data, setData]}>
{props.children}
</DataContext.Provider>
);
};
Shop component:
function Shop() {
let [data, setData] = useContext(DataContext);
function mobileClick(e) {
setData((prev) =>
prev.filter((item) => {
if (item.type === e.target.id) {
return true;
}
})
);
console.log(data);
}
return (
<div className="shopContainer">
<div className="filter">
<h1>Filter</h1>
<form>
<div>
<label for="mobile">Mobile </label>
<input type="checkbox" id="mobile" onClick={mobileClick} />
</div>
<div>
<label for="mobile">Laptop </label>
<input type="checkbox" id="laptop" />
</div>
<div>
<label for="mobile">PC </label>
<input type="checkbox" id="PC" />
</div>
<div>
<label for="mobile">Touchpad </label>
<input type="checkbox" id="Touchpad" />
</div>
</form>
</div>
<div className="main">
<DataProvider>
<Item />
</DataProvider>
</div>
</div>
);
}
setDatais called insideShop, the UI doesn't reflect the change but thedatadoes ?