During development, I've found that fields in intialState gets eliminated from redux devtools as I declare them undefined
. However, when I declare them as null
, they appearing back again in the devtool. Why it is happening?
My initial state (pending: undefined
)
const initialState = {
data: null,
pending: undefined,
error: null
};
pending
disappears from redux devtool:
Same initial state (pending: null
)
const initialState = {
data: null,
pending: null,
error: null
};
pending
appears back in redux devtool:
2 Questions:
- What pattern should I stick to? (i.e declaring fields as
null
orundefined
)? - Is there any performance gain in terms of selecting parts of the store?