Last active
October 23, 2018 18:42
-
-
Save luciotbc/109cf7921c5808fae3d978b2a5c769aa to your computer and use it in GitHub Desktop.
BestPracticesForReact02_SampleComponent.jsx
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
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