-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Switch Stateless function cannot be given refs when run unit test #16247
Comments
How do you run the test? |
I run test by |
Some more detail: The issue is caused by the native RCTSwitch component used by Switch.render:
As you can see this component is assigned a ref. However, react-test-renderer uses the following code to check if a component is stateless:
Because RCTSwitch doesn't have a render method, the warning is raised. |
Happening with me. |
Bump to this too today when running Jest |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions. |
According to last messages there are useful info. Why closing? |
Bump just to inform I have encountered it today. |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions. |
It looks like your issue may refer to an older version of React Native. Can you reproduce the issue on the latest release, v0.55? |
Is this a bug report?
Yes
Have you read the Contributing Guidelines?
Yes
Environment
Environment:
OS: macOS High Sierra 10.13
Node: 8.6.0
Yarn: 1.1.0
npm: 5.3.0
Watchman: 4.9.0
Xcode: Xcode 9.0 Build version 9A235
Android Studio: Not Found
Packages: (wanted => installed)
react: 16.0.0-beta.5 => 16.0.0-beta.5
react-native: 0.49.1 => 0.49.1
Target Platform: iOS (11)
Steps to Reproduce
Expected Behavior
Should run unit test without console.error
Actual Behavior
Reproducible Demo
App.js
file__tests__/App.test.js
filepackage.json
fileThe text was updated successfully, but these errors were encountered: