callstack / callstack/react-native-paper

OutlineStyle crashes on Android but not on iOS

Abierto
#4,769 2 comentarios 5 reacciones 0 asignados Ver en GitHub
bug
Lenguaje dominante
TypeScript
Estrellas
14.5k
Forks
2.2k
Merge medio
5 d 23 h
PR fusionados (30 d)
12

Descripción

### Current behaviour
In updating my project to Expo 53 (RN 0.79.5, RNP 5.14.5), I got crashes on Android, but not on iOS. With Expo dev tools it became clear that AndroidTextInput was receiving a ReadableNativeMap that it couldn't cast to a String (in Java). According to RNP:src:components:TextInput:TextInput.tsx:Props:outlineStyle, it's supposed to be a StyleProp, which works fine on iOS. But, on Android, it crashes. Since the type definitions don't allow for the newer (I think) outlineWidth property, I've worked around the problem thus:

const workaround = isAndroid
? { outlineWidth: 1 }
: { outlineStyle: { borderWidth: 1 } }

return

and this seems to work fine.

I don't know where the discrepancy comes it, but maybe someone working on this project knows, FWIW.

### Expected behaviour
No crash, and getting a border of width 1.

### How to reproduce?
Build a project with a Paper TextInput and set outlineStyle to { borderWidth: 1} on Android.

### Preview
https://photos.app.goo.gl/mxwqP1HV19R3tCif9

### What have you tried so far?
I have a workaround; see above

### Your Environment

| software | version
| --------------------- | -------
| ios | x
| android | 14
| react-native | 0.79.5
| react-native-paper | 5.14.5
| node | 22.14.0
| npm or yarn | yarn 4.9.2
| expo sdk | 53.0.19

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.