-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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
[Bug][Android] NativeMethodMixins don't work unless the view has a native property #9382
Comments
@facebook-github-bot label Android |
I suspect NativeViewHierarchyOptimizer would be responsible of this bug. If React detects that Edit: Just noticed https://facebook.github.io/react-native/docs/view.html#collapsable , is that intended for this kind of purposes? |
Since I've created this bug, I have verified my suspicion that the backing native view was never created. Now I always force it to be created with collapsable property. It's a minor annoyance, but I can live with it. |
NativeMethodMixins don't work unless the view has a native property. As far as I know this bug only happens on Android, I'm testing with a device on Android Marshmallow API 23, according to one of my coworkers the example below has no issue on iOS.
I've brought down my test case to this simple component.
When you render this component, you should see something like
0 0 50 0
in the console while debugging with Chrome. Now if I removestyle={{opacity:1}}
part, I getundefined undefined undefined undefined
in the console. The expected behavior is I should keep getting the same log even when the style prop is removed.Putting break points in NativeViewHierarchyManager#createView method, it was never invoked with
myView
when the native property is removed. I check which views are created on the native side by printing withfindNodeHandle
function.The text was updated successfully, but these errors were encountered: