Situation: We've used patch-package
to the react-native
package in order to disable adding a new line when the user presses return
in multiline TextInput
.
Problem: We only want this behavior of TextInput
in one section of the app but not anywhere else.
Question: How should I create a new component that mimics the original TextInput
? In the end, I'd like to have two components named TextInput
and OriginalTextInput
. If the multiline
prop is true, the former should not add a new line when pressing return and the opposite for the latter.
I'm all ears on other ways of solving this problem as long as it doesn't involve using the props of TextInput
.