When trying to use the new useSelector hook (see below example) of react-redux typescript gives an error that the function does not exist:
Module '"../../../node_modules/@types/react-redux"' has no exported member 'useSelector'. TS2305
Example:
import * as React from "react"
import { useSelector } from "react-redux"
import { Message } from "./Message"
export const MessageContainer = () => {
const searchValue = useSelector((state) => state.search)
return (
<Message searchValue={searchValue} />
)
}
Used versions: "react-redux": "^7.1.0-alpha.5" "@types/react-redux": "^7.0.9"
@types/react-redux
which has 7.0.9 version. These hooks were added in 7.1.0. – ugh StackExchange