Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Module '"<file path>/react-redux"' has no exported member 'Dispatch'

I am following a TypeScript-React-Starter tutorial, and wrapping a component into a container, Hello.tsx. Line 4 is

import {connect, Dispatch} from 'react-redux';

and throws the following error on Dispatch:

Module '"../../node_modules/@types/react-redux"' has no exported member 'Dispatch'.


How do I import Dispatch?

Do I need to update something? npm install doesn't help, not even after updating to the latest npm version.

like image 227
Super Jade Avatar asked Dec 16 '25 20:12

Super Jade


1 Answers

This really a breaking change. Dispatch is part of "redux" instead of "react-redux".

import { connect } from "react-redux";
import { Dispatch } from "redux";

For more information visit TypeScript-React-Starter Issue

like image 64
Murtaza Hussain Avatar answered Dec 19 '25 12:12

Murtaza Hussain



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!