I am currently diving deep into learning React Native with Express.js on the backend and React-Native on the frontend. I have implemented a multiline TextInput in my form like below:
<TextInput
style={{ textAlign: 'center', fontSize: 22 }}
multiline = {true}
numberOfLines = {4}
....
/>
After inputting data, the form is submitted using the following code snippet:
onQuestionSubmit() {
fetch('url', {
credentials: 'same-origin',
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
databaserow: this.state.blahblah,
}),
})
}
However, when I retrieve and render the data from the database, it appears as a single line even if I pressed "enter" for line breaks while entering the text. How can I maintain the line breaks when submitting the form?