// ... // 2) component props (always named IProps) interface IProps { // ... } // 2) (optional) constants const SOME_VALUE = 1 ; // ... // 3) default export of main component export default function ComponentName({ prop1, prop2 = 'default value', }: IProps) { // 3.1) Hook s // 3.2) Guard clauses if (someCondition) { return null ; } if (someOtherCondiation) { return <Placeholder /> ; } // 3.3) The happy path of the component return <div>My component</div> ; } // 4) Everything else, like helper functions, types, custom hooks, sub components