[React Native] react-native-paper TextInput 색 수정

Beanzinu·2021년 9월 14일
0

React-Native

목록 보기
1/6

What I want

react-native-paper 의 TextInput 컴포넌트의 default color 를 custom color로 변경

What I do

react-native-paper docs 에 나와있는 대로 props 에 underlineColor , selectionColor 등을 String으로 전달
<예시>

<TextInput selectionColor='white' underlineColor='white' />

How to Fix

Docs 에 있는 props 들은 아무리 고쳐도 색이 바뀌지 않아서 검색을 해보니 'theme' props로 전달해야 원하는 결과를 얻을 수 있었다.
<예시>

const styles = {
	theme : {
    	colors : {
        	underlineColor : 'white' ,
            primary : 'color' 
        }
    }
}
<TextInput theme={styles.theme} />
profile
당신을 한 줄로 소개해보세요.

0개의 댓글