Frontend
Back to frontend track
Deprecated

Overview

React TypeScript: Migrate useState - 1

Remember our question "Hooks: useState - 1" but that was in JavaScript. Try to migrate it to TypeScript.

In case of any issues, contact us on Discord

Setup Question in Local

If you do not have pnpm installed, run the following command:

npm install -g pnpm

Then run the following commands:

git clone https://github.com/yaralahruthik/fh-react.git
cd fh-react
pnpm install
cd ts-migrate-use-state-1
pnpm install

Run the dev server and open the respective dev URL as shown by Vite in your browser.

pnpm dev

Question

Remember our question "Hooks: useState - 1" but that was in JavaScript. Try to migrate it to TypeScript.

Why did the TypeScript developer quit their job working on a React project? They couldn't handle all the 'prop'-erty damage!

Objectives

  • Migrate all the .js, .jsx files to .ts, .tsx files.
  • Make sure there is no use of any type in the code.

Resources to Refer