Answer the question
In order to leave comments, you need to log in
Is it possible to call ReactDOM.render() from JS when using JSX?
I am studying React and the question arose:
As I understand it, the code written with JSX does not overlap in scope with regular JS. So the question is, if I want to get the data in "regular" JS and then call ReactDOM.render() after getting it, how is it possible to do that?
Answer the question
In order to leave comments, you need to log in
JSX is transformed into regular js.
var Nav, Profile;
// Input (JSX):
var app = <Nav color="blue"><Profile>click</Profile></Nav>;
// Output (JS):
var app = React.createElement(
Nav,
{color:"blue"},
React.createElement(Profile, null, "click")
);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question