Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support React class contextType #109

Merged
merged 5 commits into from
Oct 27, 2018
Merged

Support React class contextType #109

merged 5 commits into from
Oct 27, 2018

Conversation

troch
Copy link
Collaborator

@troch troch commented Oct 24, 2018

  • React 16.6.0 above and only (initialContext will be undefined anywhere else)
  • Docs update
  • Tests: commented out, it needs a new version of enzyme

@troch troch added react Something related to React packages feature A new feature labels Oct 24, 2018

* The `initialProps` are all props passed into the `WrappedComponent`.
* The `initialContext` is the initial context context value of the provided `Context` (see below, React >= 16.6.0 only)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

context context -> context


* The `initialProps` are all props passed into the `WrappedComponent`.
* The `initialContext` is the initial context context value of the provided `Context` (see below, React >= 16.6.0 only)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

context context -> context


`handler`, `errorHandler` and `aperture` will then be called with two arguments:

* `initialProps`: the component props when your component is instanciated
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instanciated -> instantiated

`handler`, `errorHandler` and `aperture` will then be called with two arguments:

* `initialProps`: the component props when your component is instanciated
* `initialContext`: the value of `Context` when your component is instanciated
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instanciated -> instantiated

Copy link
Collaborator

@thisRaptori thisRaptori left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@troch troch merged commit 683a213 into master Oct 27, 2018
@troch troch deleted the context branch October 27, 2018 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature react Something related to React packages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants