MCPcopy Index your code
hub / github.com/callstack/react-native-paper / TextInputExample

Function TextInputExample

example/src/Examples/TextInputExample.tsx:87–844  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

85};
86
87const TextInputExample = () => {
88 const [state, dispatch] = React.useReducer(inputReducer, initialState);
89 const {
90 text,
91 customIconText,
92 name,
93 outlinedText,
94 largeText,
95 flatTextPassword,
96 flatLongText,
97 outlinedLargeText,
98 outlinedCustomLabel,
99 outlinedTextPassword,
100 outlinedLongText,
101 nameNoPadding,
102 customStyleText,
103 nameRequired,
104 flatDenseText,
105 flatDense,
106 outlinedDenseText,
107 outlinedDense,
108 flatMultiline,
109 flatTextArea,
110 flatUnderlineColors,
111 outlinedMultiline,
112 outlinedTextArea,
113 outlinedColors,
114 maxLengthName,
115 flatTextSecureEntry,
116 outlineTextSecureEntry,
117 iconsColor: {
118 flatLeftIcon,
119 flatRightIcon,
120 outlineLeftIcon,
121 outlineRightIcon,
122 customIcon,
123 },
124 } = state;
125
126 const _isUsernameValid = (name: string) => /^[a-zA-Z]*$/.test(name);
127
128 const theme = useExampleTheme();
129
130 const inputActionHandler = (type: keyof State, payload: string) =>
131 dispatch({
132 type: type,
133 payload: payload,
134 });
135
136 const changeIconColor = (name: keyof State['iconsColor']) => {
137 const color = state.iconsColor[name];
138
139 const newColors = {
140 ...state.iconsColor,
141 [name]: !color
142 ? theme.isV3
143 ? theme.colors.primary
144 : theme.colors?.accent

Callers

nothing calls this directly

Calls 5

useExampleThemeFunction · 0.90
inputActionHandlerFunction · 0.85
changeIconColorFunction · 0.85
_isUsernameValidFunction · 0.85
configureFontsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…