title: How to push to array value of reducer state in redux toolkit?
body: <p>I have a simple reducer function</p>
  <pre><code>import { createSlice, PayloadAction } from '@reduxjs/toolkit';
  import { TSnackBarProps } from 'plugins/notification/NotificationContext';
  import { MAX_STACK } from 'plugins/notification/NotificationsStack';
  
  interface INotificationState {
    notifications: TSnackBarProps[];
  }
  
  const initialState: INotificationState = {
    notifications: [],
  };
  
  const notificationSlice = createSlice({
    name: 'notification',
    initialState,
    reducers: {
      addNewNotification(state, action: PayloadAction&lt;TSnackBarProps&gt;) {
        const { notifications } = state;
        const { payload: notification } = action;
        if (notifications.find((n) =&gt; n.severity === notification.severity &amp;&amp; n.key === notification.key)) {
          return;
        }
        if (notifications.length &gt;= MAX_STACK) {
          notifications.splice(0, notifications.length - MAX_STACK);
        }
  
        state.notifications.push(notification);
      },
    },
  });
  export default notificationSlice.reducer;
  </code></pre>
  <p>But, it throws the error as shown below:
  <a href="https://i.stack.imgur.com/xcvxh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xcvxh.png" alt="enter image description here" /></a></p>
  <p>I am just starting to write this reducer and got stuck here. Thanks for your help.</p>
  <p>Also, TSnackBarProps is just SnackBarProps type from material-ui with severity property added.</p>