Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RNMobile] Resolve Text Entry Issues/Errors in Alt Text Settings (#33975
) * Resolve render error This commit aims to fix the render error outlined here: #33057 (review) The "outside" changes that happen when text is changed in the BottomSheetTextControl component should not be called directly from that component. Instead, they're now called within the useEffect hook. * Replace "value" prop with "defaultValue" The purpose of this commit is to address the text entry issues that currently exist for the TextInput component, as described here: facebook/react-native#30503 A working workaround propose in that thread is to replace the "value" prop with "defaultValue". * Simplify component by removing unecessary hooks The introduction of the "defaultValue" prop in f6d9697 means that it's no longer necessary to keep the value in state. "defaultValue" allows for text to be automatically changed as it's typed. See: https://reactnative.dev/docs/textinput#defaultvalue We don't need to use "onChangeText" for the purpose of updating the input's text and can instead use it to invoke the "onChange" function. We can also remove the useState and useEffect hooks, as they're not necessary to update the component's value.
- Loading branch information