如何检测键入的字符是退格键/删除
if (e.nativeEvent.key === 'Backspace')
尝试了这个但没用
答案 0 :(得分:2)
https://facebook.github.io/react-native/docs/textinput#onkeypress
<TextInput
onKeyPress={({ nativeEvent }) => {
if (nativeEvent.key === 'Backspace') {
...doTheMagic();...
}
}}
/>