Skip to content

Instantly share code, notes, and snippets.

@luciotbc
Last active October 23, 2018 18:42
Show Gist options
  • Save luciotbc/109cf7921c5808fae3d978b2a5c769aa to your computer and use it in GitHub Desktop.
Save luciotbc/109cf7921c5808fae3d978b2a5c769aa to your computer and use it in GitHub Desktop.
BestPracticesForReact02_SampleComponent.jsx
export default class SampleComponent extends React.Component<Props, State> {
// 1. Constructor
constructor(props) {
}
// React life cycle methods
componentDidCatch(){
}
// The others components methods
isAdmin(user){
}
// Render
render() {
return (
<div>
{ // Just JSX tags prevent create new functions on render }
</div>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment