Skip to content

Instantly share code, notes, and snippets.

@glaucia86
Created August 26, 2018 22:13
Show Gist options
  • Save glaucia86/4b891ac92ddfad50b316cc2fdbc14155 to your computer and use it in GitHub Desktop.
Save glaucia86/4b891ac92ddfad50b316cc2fdbc14155 to your computer and use it in GitHub Desktop.
/**
* Arquivo: defaultProps-jsx.ts
* Author: Glaucia Lemos
* Data: 23/08/2018
*/
// Antes:
export interface Props { name?: string }
export class Saudar extends React.Component<Props> {
render() {
const { nome } = this.props;
return <div>Fala ${nome!.toUpperCase()}!</div>
}
static defaultProps = { nome: 'Glaucia Lemos' }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment