Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash course notes on Typescript in React #33

Open
RyKilleen opened this issue Feb 28, 2022 · 0 comments
Open

Crash course notes on Typescript in React #33

RyKilleen opened this issue Feb 28, 2022 · 0 comments
Labels
post idea An idea for a blog post

Comments

@RyKilleen
Copy link
Owner

RyKilleen commented Feb 28, 2022

Tips tricks and best practices for real life Typescript usage

  • shout out (react typescript handbook)[https://react-typescript-cheatsheet.netlify.app/]
  • prefer inference to explicit typing or casting
  • Avoid using any
  • use unknown where you'd use any to avoid typing acrobatics, especially in relation to third-party libraries
  • type props instead of using React.FunctionComponent
  • type guarding when using unions ReactNode
  • Working with third party libraries (and the joy of 3rdPartyType["key"]
@RyKilleen RyKilleen added the post idea An idea for a blog post label Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
post idea An idea for a blog post
Projects
None yet
Development

No branches or pull requests

1 participant