React.js: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
(One intermediate revision by the same user not shown) | |||
Line 19: | Line 19: | ||
=== Elements === | === Elements === | ||
* React.createElement(ReactClass,props,children) | |||
<syntaxhighlight lang="js"> | <syntaxhighlight lang="js"> | ||
const root = React.createElement( | const root = React.createElement( | ||
Line 31: | Line 33: | ||
{ href: "mailto:tome@email.com" }, | { href: "mailto:tome@email.com" }, | ||
React.createElement("h1", {}, "React In Action"), | React.createElement("h1", {}, "React In Action"), | ||
React.createElement("em", {}, "... | React.createElement("em", {}, "...another children") | ||
) | ) | ||
) | ) | ||
); | ); | ||
</syntaxhighlight> | </syntaxhighlight> |
Latest revision as of 01:08, 27 November 2017
Installation
npm install -g create-react-app
You first application
Create an application
create-react-app my-app
Running an appication
cd my-app
npm start
Code
Elements
- React.createElement(ReactClass,props,children)
const root = React.createElement(
"div",
{},
React.createElement(
"h1",
{},
"Hello, world!",
React.createElement(
"a",
{ href: "mailto:tome@email.com" },
React.createElement("h1", {}, "React In Action"),
React.createElement("em", {}, "...another children")
)
)
);