Created
September 28, 2025 21:07
-
-
Save IlyaIvanchikov/da6df6982b0e7cbe60e0511fc6a50d15 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| When declaring functions on the top-level of a module, | |
| declare their return types. | |
| ```ts | |
| const myFunc = (): string => { | |
| return "hello"; | |
| }; | |
| ``` | |
| One exception to this is components which return JSX. | |
| No need to declare the return type of a component, | |
| as it is always JSX. | |
| ```tsx | |
| const MyComponent = () => { | |
| return <div>Hello</div>; | |
| }; | |
| ``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment