score:1

Accepted answer

componentDidMount() { // componentWillMount is deprecated
  const tests = JSON.parse(localStorage.getItem("tests"));

  tests.forEach((test) => {
    console.log(test); // this should fire 4 times with results like "save" or "not" just to check if everything is allright

    if (test === 'save') {
      this.onSave();
    } else if (test === 'not') {
      this.onNot()
    }
  })
}

Related Query

More Query from same tag