0
render() {
        return (
            <div>
                {this.props.data.map(row => JSON.stringify(row)).join(<br/>)}
            </div>
        )
    }


is rendered as [object Object] instead of newline. How do I do this? Is there an other way than dangerouslySetInnerHTML={{<br/>}} to achieve this? More like a template for loop?

Oba Api
  • 173
  • 1
  • 8
  • 1
    Take a look at https://www.reactshark.com/blog/map-inside-jsx. You simply return you JSX and the rest is handled by React (also add an unique key to each element, [don't use indexes as unique identifiers](https://stackoverflow.com/a/46735689/9878135)) – Myzel394 Dec 25 '21 at 20:30

0 Answers0