React is a view library by facebook. The easiest way to get started with it using jsfiddle. Here we will have a look at writing a simple Hello world in react.
The following code will render “Hello World!” inside h1
in div#main
.
ReactDOM.render(
<h1>Hello World!</h1>,
document.getElementById("main")
)
[iframe width=”100%” height=”300″ src=”//jsfiddle.net/vkbansal/rhrr246L/embedded/” allowfullscreen=”allowfullscreen” frameborder=”0″]
The HTML like syntax you see is called JSX. It is just syntactic sugar for the following code.
ReactDOM.render(
React.createElement(
"h1",
null,
"Hello World!"
),
document.getElementById("main")
);
JSX can be compiled to JS using tools like babel.
Best Open Source Business Intelligence Software Helical Insight is Here
A Business Intelligence Framework
Subscribe
Login
0 Comments