Skip to content

Instantly share code, notes, and snippets.

@gondar00
Created December 15, 2017 08:04
Show Gist options
  • Select an option

  • Save gondar00/e5df87ac31cf94fee581bf650dfe0dc2 to your computer and use it in GitHub Desktop.

Select an option

Save gondar00/e5df87ac31cf94fee581bf650dfe0dc2 to your computer and use it in GitHub Desktop.
const jsContainer = document.getElementById("js");
const reactContainer = document.getElementById("react");
const render = () => {
jsContainer.innerHTML = `
<div class="demo">
Hello JS
<input />
<p>${new Date()}</p>
</div>
`;
ReactDOM.render(
React.createElement(
// html tag
"div",
//attributes
{ className: "demo" },
// content
"Hello React 101",
React.createElement("input"),
React.createElement(
"p",
null,
new Date().toString()
)
),
reactContainer
);
}
setInterval(render, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment