title: How to use redux-toolkit createSlice with React class components
body: <p>I've started using the redux-toolkit slicers in functional components, (example from react-redux example)</p>
  <p>slicer:</p>
  <pre><code>export const counterSlice = createSlice({
    name: 'counter',
    initialState: {
      value: 0,
    },
    reducers: {
      increment: state =&gt; {
        state.value += 1;
      },
      decrement: state =&gt; {
        state.value -= 1;
      },
      incrementByAmount: (state, action) =&gt; {
        state.value += action.payload;
      },
    },
  });
  </code></pre>
  <p>use in component:</p>
  <pre><code>const count = useSelector(selectCount);
  const dispatch = useDispatch();
  
  return (
    &lt;button
      className={styles.button}
      aria-label=&quot;Increment value&quot;
      onClick={() =&gt; dispatch(increment())}
    &gt;
  )
  </code></pre>
  <p>my question is how can I use this slicer in the class component since I cant use hooks inside them.
  I've tried using connect (from redux) but I can't find a way to &quot;stitch&quot; the actions and selectors from the slicer to my component.
  I couldn't find any documentation on this as well.</p>