ANP ANP - 1 year ago 338
React JSX Question

How do i add a line break in render()?

in my

function i have the following code:

var cbCollection =, index) {

return <label><input type = "checkbox" name = "cbCodes" id = "cb-{index}" value={elem.Id}/>{elem.DiagCodes}</label><br />


return(<div>rest of the code</div>)


but it wont let me add the
<br />
at the end as coded, why is this and how do i fix this?

Answer Source

If the OP does not post an answer, I'd like to steal the points :D

render: function(){
  var cbCollection =, index) {
    return (
          <input type="checkbox" name="cbCodes" id="cb-{index}" value{elem.Id} />
        <br />
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download