Skip to content

Improve message "dispatcher.useState is not a function" when mixing react@next with [email protected] #14039

@geoffdavis92

Description

@geoffdavis92

Do you want to request a feature or report a bug?
Report a bug

What is the current behavior?
Getting TypeError: dispatcher.useState is not a function when trying to call useState; this is happening in a create-react-app, as well as in the CodeSandbox example below.

Example:
https://codesandbox.io/s/7kp55lwwpj

What is the expected behavior?
useState hook function should execute without error as defined in the API documentation

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?

React: v16.7.0-alpha.0
React-DOM: 16.5.2 (CSB), 16.7.0-alpha.0 (local)
React-Scripts: 2.0.3 (CSB), 2.1.0 (local)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions