Skip to content

Instantly share code, notes, and snippets.

@dskecse
Last active May 19, 2016 16:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dskecse/65da8e6ea849aade7c7f39c96adf96f1 to your computer and use it in GitHub Desktop.
Save dskecse/65da8e6ea849aade7c7f39c96adf96f1 to your computer and use it in GitHub Desktop.
stateless React component
import React from "react"
import { render } from "react-dom"
const mountNode = document.createElement("div")
mountNode.id = "container"
document.body.appendChild(mountNode)
const name = "David"
function Component(props) {
const { name } = props
return <h1>Hello {name}</h1>
}
render(<Component name={name} />, mountNode)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment