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

Shallow rendering uses .type and throws deprecations #4730

Closed
aaronjensen opened this issue Aug 27, 2015 · 3 comments · Fixed by #4735
Closed

Shallow rendering uses .type and throws deprecations #4730

aaronjensen opened this issue Aug 27, 2015 · 3 comments · Fixed by #4735

Comments

@aaronjensen
Copy link

When calling renderer.render() I get:

Warning: Foo.type is deprecated. Use Foo directly to access the class

It seems to be here, and a few other places:

https://github.com/facebook/react/blob/master/src/test/ReactTestUtils.js#L418

I wonder if #4009 broke this entirely...

@sophiebits
Copy link
Collaborator

.type on a React element still works. It does not work on React classes. It sounds like you're doing .render(Foo) instead of .render(<Foo />).

@aaronjensen
Copy link
Author

Spot on @spicyj, thanks for the pointer. The funny thing is it totally worked otherwise... It may be nice if that was an invariant.

@sophiebits
Copy link
Collaborator

Okay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants