We are going to follow a similar pattern to connect the ask page to our Redux store. Let's get started:
- In AskPage.tsx, let's change the import statements from React, that is, Form.tsx and QuestionsData.tsx, so that they look as follows:
import React, { FC, useEffect } from 'react';import { Form, required, minLength, Values, SubmitResult} from './Form';import { PostQuestionData, QuestionData } from './QuestionsData';
- Let's add the following import statements:
import { connect } from 'react-redux';import { ThunkDispatch } from 'redux-thunk';import { postQuestionActionCreator, AppState, clearPostedQuestionActionCreator} from './Store';import { AnyAction } from 'redux';
- Add a props interface for the data and ...