Typescript-react-starter: has no exported member 'Dispatch'.

Created on 3 Jul 2018  ·  9Comments  ·  Source: microsoft/TypeScript-React-Starter

I'll do it according to the instructions . There was a mistake

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

Failed to compile.

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

Most helpful comment

Dispatch is no longer part of the react-redux library. To fix the issue, replace

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

with

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

All 9 comments

Confirm the issue.

My English is not very good,I'm not sure if you understand what I'm talking about。

@wuchaoya I just want to say that I am able to reproduce this issue o my computer and I would like to get developers attention to this case.

修改package里面的版本可以解决
"@types/react-redux": "^4.0.30"

Dispatch is no longer part of the react-redux library. To fix the issue, replace

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

with

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

Thank you very much.

Might need to update the Readme.md file as well, in the Readme.md it's still using:

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

Hello,
the readme is still out of date.
Thanks !
Capture d’écran 2019-05-03 à 15 04 35

Hello, is somewhere some script to execute and to fix it because I have to spend two hours to fix this case throughout my whole app? Thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BenjaminWatts picture BenjaminWatts  ·  6Comments

Arelav picture Arelav  ·  4Comments

nikhilyeole1 picture nikhilyeole1  ·  9Comments

emanuelef picture emanuelef  ·  3Comments

wongjiahau picture wongjiahau  ·  9Comments