How to stop render If I get the same value? Should I write some condition for this? Like
if (JSON.stringify(state) === JSON.stringify(payload) {
return state
}
return payload
Here is a whole example
https://codesandbox.io/s/return-redux-toolkit-ersqo?file=/src/redux/slices/slice.js
here is a part of code
const someSlice = createSlice({
name: "someSlice",
initialState: {},
reducers: {
actionSuccess: (state, { payload }) => payload
}
});