Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6211

Styling output of Object in Typescript react

$
0
0

I have an object output that looks like this:

name: "James Charles"
address: "<font face="Arial" size="2">10109 New York. Ste. C, New York NY</font>"
phone: "784-247-7926"
email: "jamescharles@yahoo.com"

I'm doing this in my render():

<ul>
    {(Object as any).entries(this.state.DocList).map((object, i) => <li>{object}</li>)}
</ul>

However, the output is displaying something like this:

nameJames Charles
address<font face="Arial" size="2">10109 New York. Ste. C, New York NY</font>
phone784-247-7926
emailjamescharles@yahoo.com

I'm trying to style up the output to add for example a space between the key and value, a semi colon, maybe a span class so I can bold the key fields.

How can I get more control of the output? And what would be the best way to strip the html from the address field so it's not displaying it in the address?

So that my output looks similar to this:

  • Name: James Charles
  • Address: 10109 New York. Ste. C, New York NY
  • Phone: 784-247-7926
  • Email: jamescharles@yahoo.com

Viewing all articles
Browse latest Browse all 6211

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>