9
राज्य को अद्यतन नहीं करने पर प्रतिक्रिया सेट करें
इसलिए मेरे पास यह है: let total = newDealersDeckTotal.reduce(function(a, b) { return a + b; }, 0); console.log(total, 'tittal'); //outputs correct total setTimeout(() => { this.setState({dealersOverallTotal: total}); }, 10); console.log(this.state.dealersOverallTotal, 'dealersOverallTotal1'); //outputs incorrect total newDealersDeckTotal संख्याओं का एक मात्र [1, 5, 9]उदाहरण है, हालाँकि this.state.dealersOverallTotalसही कुल नहीं देता है लेकिन …