The draft returned by the produce function's callback should make a mutable clone from the original state. Currently immutability is retained:
interface IState {
readonly foo: boolean;
}
const state: IState = {
foo: false
};
produce(state, draft => {
draft.foo = true; // Error: Cannot assign to 'foo' because it is a constant or a read-only property.
});