Created
March 6, 2018 08:41
-
-
Save sparrow/439e907e66d05fd9649731c1ecad3d7f to your computer and use it in GitHub Desktop.
This is a JavaScript code snippet that we used for our blog post https://rubygarage.org/blog/things-vue-takes-from-react-and-angular at RubyGarage. This is an example of rendering functions & JSX support implementation in React.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
const Demo = () => { | |
const sayHi = () => | |
alert('Hi.') | |
return ( | |
<span onClick={sayHi}>Say hi!</span> | |
) | |
} | |
export default Demo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment