almost 8 years ago
Use Jquery to get DOM elements
React.js injects code into HTML block like this:
To use Jquery to accomplish the samething:
$("#content") along is not enough, because it returns a jquery object instead of a DOM object.
Why does React.js render function's return statement is surrounded by a parenthese?
When the following line is entered:
The output is not an error, but instead str1 is assigned to variable test. This is because a semicolon has been inserted by js automatically like this:
When working with React.js, this is what a typical render() looks like:
To make sure the entire div block is returned as a whole instead of just the first line, the parenthese are needed.