MCPcopy Index your code
hub / github.com/callstack/react-native-testing-library / getTextInputValue

Function getTextInputValue

src/helpers/text-input.ts:10–21  ·  view source on GitHub ↗
(instance: TestInstance)

Source from the content-addressed store, hash-verified

8}
9
10export function getTextInputValue(instance: TestInstance) {
11 if (!isHostTextInput(instance)) {
12 throw new Error(`Element is not a "TextInput", but it has type "${instance.type}".`);
13 }
14
15 return (
16 instance.props.value ??
17 nativeState.valueForInstance.get(instance) ??
18 instance.props.defaultValue ??
19 ''
20 );
21}

Callers 6

matchDisplayValueFunction · 0.90
clearFunction · 0.90
pasteFunction · 0.90
typeFunction · 0.90
toHaveDisplayValueFunction · 0.90

Calls 1

isHostTextInputFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…