basarat / typescript-book

:books: The definitive guide to TypeScript and possibly the best TypeScript book :book:. Free and Open Source 🌹
https://basarat.gitbook.io/typescript/
Other
20.77k stars 2.54k forks source link

Add another default export concern #590

Closed rajington closed 4 years ago

rajington commented 4 years ago

Type annotations for default export

Default exports cannot be annotated

const HighCharts: React.FC<Props> = ...
export default HighCharts;

Can be one statement for named exports:

export const HighCharts: React.FC<Props> = ...
basarat commented 4 years ago

What is suggested Needs two lines for annotations What I think it really means Needs two lines for non-class, non-function which is already present : https://github.com/basarat/typescript-book/blob/master/docs/tips/defaultIsBad.md#needs-two-lines-for-non-class--non-function

So closing. Thanks for sending the PR though, appreciated :rose:

rajington commented 4 years ago

i see now, thanks!