Skip to content

Incompatible with React 16.3 Context Provider API#246

Description

@kirill-konshin

馃悰 Bug Report

To Reproduce

Following code:

const Context = React.createContext();

const Foo = () => (<Context.Provider value={'xxx'}/>);

will result in an error:

Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.

I caught this error when I was using react-apollo@2.5.3 https://github.com/apollographql/react-apollo/releases/tag/v2.5.3:

The ApolloProvider / ApolloConsumer implementations have been refactored
to use React 16.3's new context API.

React installed in the project is at version 16.9.0.

I suspect it's because react-native-macos is far behind modern react-native which supports hooks and context API properly, see #226.

Environment

  • macOS v10.14.6
  • react-native-macos v0.19.3

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions