David
David

Reputation: 47

REACT Native Modal transparent prop is bugging on Android

The transparent prop on Modals leads to an error on Android simulator but not on iOS.

<Modal visible={props.visible} transparent='true' animationType='slide' >

The error says: Error while updating property 'transparent' of a view managed by: RCTModalHostView

If I simply remove the transparent prop then it works but I loose my transparent background obviously which I can't have happening.

I run expo 3.4.1

Upvotes: 0

Views: 556

Answers (1)

hong developer
hong developer

Reputation: 13906

The type of transporter is Bool. But you're putting the type in a string. iOS may recognize your string as a Bool, but Android may not. Fill out the type according to the type.

transparent

The transparent prop determines whether your modal will fill the entire view. Setting this to true will render the modal over a transparent background.

TYPE : bool, REQUIRED : No

<Modal visible={props.visible} transparent={true} animationType='slide' >

Upvotes: 2

Related Questions