I am learning react native and I have express.js in the backend and react-native in the front end. I have a multiline textInput like this
<TextInput
style={{ textAlign: 'center', fontSize: 22 }}
multiline = {true}
numberOfLines = {4}
....
/>
Then the form is submitted like this.
onQuestionSubmit() {
fetch('url', {
credentials: 'same-origin',
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
databaserow: this.state.blahblah,
}),
})
}
When I send stuff to the database and I render it, it comes back as a single line even if I hit "enter" or line breaks several times. What do I have to do in order to preserve the line breaks created while submitting the form?