Let's connect the home page to the store:
- In HomePage.tsx, let's add the following import statements:
import { connect } from 'react-redux';import { ThunkDispatch } from 'redux-thunk';import { AnyAction } from 'redux';
We've imported a function called connect from React Redux that will allow us to connect the HomePage component to the store. We've also imported some useful TypeScript types from Redux and Redux Thunk.
- We are going to use the Redux store for the unanswered questions, so let's import the action creator that will get these, along with the type for the store's state:
import { getUnansweredQuestionsActionCreator, AppState} from './Store';
- Let's remove the getUnansweredQuestions function from the import ...