Open monotv opened 7 years ago
Thanks for reporting @monotv.
I just tested this on a Android 7 device using the Example project. All text inputs are working fine.
Could you also test it with the Example project so we can make sure this is related with the library. The project is using react-native version 0.50.0
btw.
same here. Android 5.0, React Native 0.55.
Also crashing with unknown view tag exception for me. Android 7.0 RN 0.55
@Dantalion & @csotiriou Still an issue?
crashing in RN 0.56
What's the output of crash @winadiw?
I encountered this same issue and did some troubleshooting
Primarily it seems to be a user error, in my case I was passing the backgroundColor
prop to a hoshi
component which does not use the backgroundColor
prop, this is because I was trying several different components before settling on the hoshi
Passing the prop backgroundColor
to the TextInput
react native component causes a crash on android.
Changing the library code fixes this, but is not necessary, like so:
const {
label,
style: containerStyle,
inputStyle,
labelStyle,
maskColor,
borderColor,
borderHeight,
inputPadding,
height: inputHeight,
backgroundColor,
...restOfProps,
} = this.props;
const { width, focusedAnim, value } = this.state;
const flatStyles = StyleSheet.flatten(containerStyle) || {};
const containerWidth = flatStyles.width || width;
return (
<View
style={[
styles.container,
containerStyle,
{
height: inputHeight + inputPadding,
width: containerWidth,
},
]}
onLayout={this._onLayout}
>
<TextInput
ref={this.input}
{...restOfProps}
This adds backgroundColor and ...restOfProps
to the initial retrieval of props, then spreads that into the TextInput
component instead of ...this.props
I can submit a PR to fix this if you'd like, but it seems likely that the user could simply stop passing backgroundColor
in
Thanks for finding out the problem @wizebin. I'd like to merge that patch if you could create a PR. I agree that it sounds like a user error but I'd like to eliminate it as people keep experiencing that.
Any progress on that? )
Versions:
Android 7
First exception:
Then:
This finally crashes the app:
Android expects colors as int yet somewhow it is passed as a string it seems.
Looks like there is an issue with Animations in Android: https://github.com/facebook/react-native/issues/13984