Open dmitri-bel opened 6 months ago
Similar issue to https://github.com/callstack/react-native-paper/issues/4294.
Have the same. It's bug will show if you use TextField and NativeWind (Tailwind CSS). I found and fixed 2 bugs.
Platform.OS === 'web'
open: node_modules/react-native-ui-lib/src/components/textField/Input.js
change string Constants.isWebLine 70:
return <TextInput
fsTagName={recorderTag}
style={[
styles.input,
!!inputColor && { color: inputColor },
style,
Constants.isWeb ? styles.webStyle : undefined
]}
{...props}
Line 124: OLD:
const hasValue = fieldState.value !== undefined;
const inputStyle = useMemo(() => {
return [typographyStyle, colorStyle, others.style, hasValue && centered && styles.centeredInput];
}, [typographyStyle, colorStyle, others.style, centered, hasValue]);
NEW:
const hasValue = fieldState.value !== undefined;
const hasCenteredValue = fieldState.value ? (centered && styles.centeredInput) : undefined
const inputStyle = useMemo(() => {
return [typographyStyle, colorStyle, others.style, hasCenteredValue];
}, [typographyStyle, colorStyle, others.style, centered, hasValue]);
Current behaviour
Whenever I use TextInput in my code, my app fails with the following error: "Right operand of 'in' is not an object".
Expected behaviour
No crashes when using TextInput.
How to reproduce?
Repo to reproduce: https://github.com/dmitri-bel/bug-rn-paper/ Usage of TextInput is located in /app/index.tsx.
Preview
Error in iOS simulator:![image](https://github.com/callstack/react-native-paper/assets/71018352/19d08098-78ac-442a-a5cc-55435b17eb4f)
Error in CLI:
Your Environment