Skip to Main Content
ASP.NET Core 3 and React
book

ASP.NET Core 3 and React

by Carl Rippon
December 2019
Intermediate to advanced content levelIntermediate to advanced
598 pages
12h 21m
English
Packt Publishing
Content preview from ASP.NET Core 3 and React

Connecting the home page

Let's connect the home page to the store:

  1. 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.

  1. 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';
  1. Let's remove the getUnansweredQuestions function from the import ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

ASP.NET Core 5 and React - Second Edition

ASP.NET Core 5 and React - Second Edition

Carl Rippon
ASP.NET Core 5 for Beginners

ASP.NET Core 5 for Beginners

Andreas Helland, Vincent Maverick Durano, Jeffrey Chilberto, Ed Price

Publisher Resources

ISBN: 9781789950229Supplemental Content