In Redux Toolkit, the useSelector hook from React-Redux allows you to read data from a specific slice of the Redux store inside a React component.
Import the useSelector hook from react-redux.
Use it inside your component to access the slice’s state.
Reference the slice key you defined in configureStore() (e.g., state.counter.value).