Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reactjs: br tag and ajax request

Tags:

ajax

reactjs

My question is divided into two parts:

  1. I know how to do ajax request to third party api on componentDidMount but when i tried doing same request with a function on a click event it did not happen?

  2. I also tried to use <br> tag in react to break a line but it does not render at a all and gives me error.

Can anyone please help me to understand why this is happening and how can i resolve these issues?

like image 838
sam Avatar asked Jan 01 '14 13:01

sam


1 Answers

  1. This should work. Please post a working example (e.g., on jsfiddle) that shows how you're having trouble.

  2. Try <br />. All self-closing tags must have the final slash in React.

(In the future, best to post as separate questions.)

like image 165
Sophie Alpert Avatar answered Sep 28 '22 04:09

Sophie Alpert