const copy = transform(original, stage => {
stage.someArray[index] = 42;
});
and it returns immutable copy of original object with appropriate mutations. const copy = transform(original, stage => {
stage.x = 10;
stage.y = 20;
stage.foo.bar = 123;
})
instead of Object.assign / ... mess.
This is one of reasons to limit third party libraries you use along with React. Every dependency comes at cost. If you use React and React-Foo, React-Bar, React-Baz and dozen of other React based additional libraries, then upgrading all/troubleshooting can be painful. As it was ("We ran into an error which took us 2 days to track down to a library, ...")