Question · Vibe coding with Claude Code course · Module 3: Twitter clone

Typing props with an interface

Why do we define an interface for a component's props?

Answer options

  • So the component renders faster
  • So TypeScript enforces the correct types of the data passed in
  • To add CSS styles
  • To make the component run on the server

You can check the correct answer by solving this task in the CodeWorlds game.