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 for Stateless Components #53

Merged
merged 1 commit into from
Dec 6, 2015

Conversation

lelandrichardson
Copy link
Collaborator

to: @ljharb @goatslacker

Adds support for stateless functional components.

Brought up in #45

Functional components cannot be a ref, and thus the "wrapper component" did not work with them.

Note that functional components are only available in react 0.14, so the tests for them are only run for react 0.14...

getWrappedComponent() {
const component = this._reactInternalInstance._renderedComponent;
const inst = component.getPublicInstance();
if (inst === null) {
Copy link
Member

Choose a reason for hiding this comment

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

Is there any case where inst is falsy but not null? if not, you could return component.getPublicInstance() || component? nbd

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

AFAICT its always null

@ljharb
Copy link
Member

ljharb commented Dec 5, 2015

LGTM - this seems like a minor bump?

lelandrichardson added a commit that referenced this pull request Dec 6, 2015
@lelandrichardson lelandrichardson merged commit d395726 into master Dec 6, 2015
@lelandrichardson lelandrichardson deleted the lmr--mount-stateless-components branch December 6, 2015 22:59
lelandrichardson added a commit that referenced this pull request Dec 7, 2015
- Support for Stateless Functional Components ([#53](#53))

- Tweak `describeWithDOM` messaging ([#48](#48))
- Documentation Fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants