Modal recipe
To handle React Native Modal
components, you must wrap modal content in AvoidSoftInputView
.
Example
export const ModalExample: React.FC = () => {
return (
// ... some JSX
<Modal /** ...modal props */>
<AvoidSoftInputView>
// ... wrapped content
<ScrollView>
<View>
<TextInput placeholder="Single line" />
<TextInput placeholder="Multiline" />
<Button />
</View>
</ScrollView>
</AvoidSoftInputView>
</Modal>
//... some JSX
);
};