I want to convert the following assignment to something that uses object spread instead:
bData.steps[bStepKey].params= cData[cKey]
I have tried below with no luck.
bData= {...bData, steps:{ ...bData.steps[bStepKey], params: cData[cKey]}}
You don't need the spread operator, but if you really wanted to use it:
bData = { ...bData, steps: { ...bData.steps, [bstepKey]: { ...steps[bstepKey], params: cData[cKey] }}};
Although it's not useful at all in this situation as you don't need to spread anything - your initial approach is much better:
bData.steps[bStepKey].params= cData[cKey]