Skip to content

Crash course notes on Typescript in React #33

@RyKilleen

Description

@RyKilleen

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"]

Metadata

Metadata

Assignees

No one assigned

    Labels

    post ideaAn idea for a blog post

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions