Engrain by ByteRush

TS.08 4 concepts · 2 ready

TypeScript in React and API code

Type components, hooks, context and network boundaries well.

  1. TS.08.01Typing components and propsCoreJuniorBeing written
  2. TS.08.02Generic and polymorphic componentsMid-levelBeing written
  3. TS.08.03Typing hooks, reducers and contextCoreMid-level11 min
  4. TS.08.04Runtime validation at boundariesCoreMid-level11 min

Interview questions in this module

  1. How do you type a component that accepts all native button props plus your own?
  2. How do you type useReducer actions safely?
  3. How do you make sure API responses match your TypeScript types?
  4. How do you type a context so consumers never get undefined?
  5. How would you type a component that renders either a link or a button?