Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

redux toolkit how to set empty initial state

const intialState = {
  returned: []
}

const showOnReviewSlice = createSlice({
    name: 'showOnReview',
    initialState,
    reducers: {
        reset: state => initialState
    }
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #redux #toolkit #set #empty #initial #state
ADD COMMENT
Topic
Name
9+3 =