Cant Figure Out Edit button

Still need some help with the edit button. For the life of me I cant figure it out…I got a hint to edit the selected recipe, and then map to replace the selected recipe with the recipe I edited. Which the only thing that comes to mind is to splice, but im not sure

editRecipe() {
   const recipes = [...this.state.recipes]
  this.state.selectedRecipe.name = this.state.editName;
   this.state.selectedRecipe.ingredients = this.state.editIngredients;
   this.state.selectedRecipe.directions = this.state.editDirections;
    recipes.map(//replace here?)
  }

can you explain what you are trying to do? or do you have an original thread?

That’s the original post. So I have the selectedRecipe when I click on a name from the list. When edit is press exit brings up a modal that allows the user to edit that specific recipe. However the code I have now sets the input to the selected recipe, but doesn’t save it. Meaning I can click on pizza again, and the original recipe is there not the edited recipe. So I was discussing this with another user, and he suggested to edit the recipe, and use map to replace the original recipe with the edited one. Not sure how I can do that.

Absolutely that’s no problem.