Question · Vibe coding with Claude Code course · Module 12: Medium clone

Where the use client directive goes

Claude put "use client" in components/ArticleEditor.tsx below the line import { useState } from "react". What will happen?

Answer options

  • Nothing, because the order of the directive and the imports does not matter
  • The component will work, but only in npm run dev mode
  • TypeScript will report that useState does not exist
  • npm run build will stop with an error: the directive must stand before other expressions, at the very start of the file

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