I have a complex Data object that is fetched and fed into my useImmerReducer. The initialstate is thus empty {} or null. This causes typescript to exclaim that you now shouldn't do draft.<property> now that draft might be {} or null -- which is understandable.
I think you probably have already thought about this case, so I dont think it's a bug.
How are you supposed to useImmerReducer with a null as the initialState?
I have a complex Data object that is fetched and fed into my
useImmerReducer
. The initialstate is thus empty{}
ornull
. This causes typescript to exclaim that you now shouldn't dodraft.<property>
now that draft might be{}
ornull
-- which is understandable.I think you probably have already thought about this case, so I dont think it's a bug.
How are you supposed to
useImmerReducer
with anull
as the initialState?