I want to update an deeply nested value using immer.js I'm looking for a generic solution, where the path to value comes as string. Is there a way to send the path to the value as string and update in the draft?
const data = { colors: [{id: 1, name: red}] }
const path = "colors.0.name"
const nextValue = "dark red"
produce((draft) => {
draft ... name= "dark red" // via generic path set the value
})