How to change error color for TextInput in 'react-native-paper'

2.1k views Asked by At

There is no documented error style in theming or TextInput documentation for 'react-native-paper' So the question is how to change the color for error={true} for TextInput in 'react-native-paper'?

1

There are 1 answers

2
Stich On

The example without wrapping in

<PaperProvider>
 <App />
</PaperProvider>

is here:

import { TextInput, DefaultTheme } from 'react-native-paper'
.....

return (
.....

 <TextInput
  value={...}
  .....
  theme={{
   ...DefaultTheme,
   colors: {
    .....
    error: '#B22D1D', //any color
    .....
   },
   fonts: {
    .....
   },
  }}
  .....
/>

.....
)