Closed nieselo closed 3 years ago
` const { paperList: oldItems } = this.state; //define oldItems before the .forEach
entries.forEach((entry) => { let newDOI = !oldItems.some((item) => item.doi === entry["prism:doi"]); if (newDOI) { // as before... }; });`
@dtdi The above code solves the issue. Definition of oldItems has to be moved forward.
` const { paperList: oldItems } = this.state; //define oldItems before the .forEach