First some pseudo code:
render(){
return(
<View style={{flexDirection:'row', flexWrap:'wrap'}}>
<View style={{flexDirection:'column', flexWrap:'wrap'}}>
<View style={{flexDirection:'row', flexWrap:'wrap', flexShrink:1}}>
<Text>azeaeazeazeazeazeazeazearzetareutaeriauzertaiueyrtaieuyrtaieyrtaieuyrtaieuyrtaieuzyrt</Text>
</View>
</View>
<View style={{borderWidth:1}}/>
<View style={{flexDirection:'column', flexWrap:'wrap'}}>
<Text>azeaeazeazeazeazeazeazearzetareutaeriauzertaiueyrtaieuyrtaieyrtaieuyrtaieuyrtaieuzyrt</Text>
</View>
</View>
)
}
What I want is to have my screen split and that the text gets wrapped on both sides.
What happens is the first textis written on one line (so it gets off the screen), to its right is the "borderWidth:1" and next line is the second text, overflowing
The final goal is a sign form which displays correctly as long as I don't put it in a "flexDirection:row" view, which I need to since I want both forms side by side (and up and down for responsive if on mobile)
Any hint ?
By the way the correctly displaying form is set like this :
render(){
return(
<View style={{justifyContent: "flex-start", alignItems: "stretch", minWidth:wp(10)}}>
<View style={{flexWrap:'wrap', flexShrink:1}}>
<Text style={{textAlign:'center'}}>Create your WaitForMe account.</Text>
<Text style={{textAlign:'center'}}>It’s free and only takes a minute.</Text>
<Text style={{fontWeight:'bold', margin: 2}}>Email</Text>
<TextInput style={{borderWidth: 1, margin: 2}} placeholder="E-mail address" onChangeText={(mail) => this.setState({mail})} onBlur={()=>this.validateSignUpForm()}/>
<Text style={{color:'red', margin: 2}}>{this.state.errors.mail}</Text>
<Text style={{fontWeight:'bold', margin: 2}}>Password</Text>
<TextInput style={{borderWidth: 1, margin: 2}} placeholder="Password" onChangeText={(password) => this.setState({password})} onBlur={()=>this.validateSignUpForm()}/>
<Text style={{color:'red', margin: 2}}>{this.state.errors.password}</Text>
<Text style={{margin:2, flexShrink:1}}>Passwords must be at least 8 characters long and contain at least 1 letter, 1 number and a special character</Text>
<Text style={{fontWeight:'bold', margin: 2}}>Confirm password</Text>
<TextInput style={{borderWidth: 1, margin: 2}} placeholder="Confirm password" onChangeText={(confirm) => this.setState({confirm})} onBlur={()=>this.validateSignUpForm()}/>
<Text style={{color:'red', margin: 2}}>{this.state.errors.confirm}</Text>
</View>
<Button title="Sign up" onPress={()=>this.signUp()} disabled={this.state.signUpDisabled}/>
</View>
)
}
Correct behaviour:
large screen:
small screen:
Bad behaviour (when put inside a flexDirection:'row'