callstack / callstack/react-native-paper

OutlineStyle crashes on Android but not on iOS

Open
#4,769 2 comments 5 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
14.5k
Forks
2.2k
Avg merge
5d 23h
Merged PRs (30d)
12

Description

### 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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.