React Dom not updating after updating a state array

so this function updates this state array:
let [Produits, setProduit] = useState(JSON.parse(Devis.produits))

 let changeQte = (id, e) => {
    let produittable = Produits;
    produittable.forEach((p) => {
      if ( == id) {
        p.quantityAchete = parseInt(;

the array did update without any problem but the changes aren’t getting re-rendered

  {console.log('rendering') , => (
            <div key={} className="product_column flex_center">
              <div className="productItem">{p.nom}</div>
              <div className="productItem">{p.category}</div>
              <div className="productItem">{p.prix_vente} DA</div>
                onChange={(e) => changeQte(, e)}

as you can see i’m loggin to the console to check if that line is getting executed and it does ! but the values rendered doesn’t update !

24 thoughts on “React Dom not updating after updating a state array”

Leave a Comment