Reputation: 191
I'm trying to pull data from a database which provides a JSON
response.
However no matter what I try, putting the variable into a <Text>
prop always prints
the "\n"
as text on screen.
Is there any way either client
or server
side to allow new lines to properly make there way into the app?
Upvotes: 3
Views: 1210
Reputation: 3105
That's how I handled this on my client side:
var response = fetch(...);
response = response.replace(/\\n/g,'\n');
Upvotes: 4