Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save guifromrio/fca7ac82ba7b1a05728d330932c92cc3 to your computer and use it in GitHub Desktop.
Save guifromrio/fca7ac82ba7b1a05728d330932c92cc3 to your computer and use it in GitHub Desktop.
How to write a React stateless (functional) component in TypeScript
import * as React from 'react'
const Button: React.StatelessComponent<{}> = ({children}) => (
<button
className="f4 br2 grow no-underline ph5 pv3 dib white bg-dark-pink bn shadow-3 w-100 w-auto-ns b">
{children}
</button>
)
export default Button
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment