Flow-typed: [react-redux_v7.x.x] Flow cannot import useSelector, useDispatch

Created on 15 Jul 2019  路  3Comments  路  Source: flow-typed/flow-typed

The problem:

import {
  useDispatch, // error
  useSelector, // error
} from 'react-redux';

via: https://github.com/flow-typed/flow-typed/pull/3440

Is it legal to copy old libdefs without checking them with reality?

Docs: https://github.com/reduxjs/react-redux/blob/master/docs/api/hooks.md

Most helpful comment

I added types in #3461, please take a look if any of you get a chance.

All 3 comments

Doesn't address some of the new hooks support, just wanted to get something out there to support the majority of use cases. Can be refined later.

Thanks @goodmind.

Yeah I figured it was better to get something out. I don't have time to add hooks support, someone else is welcome to do so.

I added types in #3461, please take a look if any of you get a chance.

Was this page helpful?
0 / 5 - 0 ratings