jedireza / hapi-react-views

:package: A hapi view engine for React components
MIT License
231 stars 33 forks source link

map() on array from api returns span? #41

Closed mtsewrs closed 8 years ago

mtsewrs commented 8 years ago

I do not know why it returns a span when I map in a array...

mtsewrs commented 8 years ago

This seams to be an issue with spaces in jsx...

jedireza commented 8 years ago

Thanks for opening an issue. However, without any code it's hard to know exactly what you're running into. But in general, yes mixed text elements and regular elements in JSX will produce spans around the text elements.

When element and non-element nodes are mixed, non-element text nodes are implicitly wrapped in Span tags. This can create sibling element nodes, on different physical lines of JSX code, which - as in the previous rule - are rendered without white space.

Source: http://www.bennadel.com/blog/2880-a-quick-look-at-rendering-white-space-using-jsx-in-reactjs.htm

mtsewrs commented 8 years ago

Yes, I realized that so it's fine.