React Coding Questions
Meant for real world and interview based scenarios.
- easy
TypeScript: Migrate useState - 1
FreeRemember our question "Hooks: useState - 1" but that was in JavaScript. Try to migrate it to TypeScript.
- easy
Hooks: useEffect - 1
FreeThe useEffect hook is notorious to cause majority of bugs in most React projects. Can you solve a similar bug?
- easy
Hooks: useHover
NewFreeCreate a custom hook that tracks the hover state of an element. The hook should return a boolean value indicating whether the element is being hovered over. If no element is provided, the hook should track the hover state of the entire document.
- easy
Hooks: useState - 1
FreeThis question revolves around the most frequently used hook in React development. Your task is to implement the logic for managing tasks - including storing, adding, and deleting them within a local state variable.
- medium
Design System: Buttons - 1
FreeYou would learn to build a modern reusable button component in React. We cover the same libraries used to also power ShadCN and other design systems.
- medium
Refactor: Class to Function Components - 1
Though modern React applications are built using function components, there are still many class components in the wild. You might need to refactor a class component to a function component for various reasons.
- medium
Testing: Todo App - 1
You built a Todo App and sent it to the testing team. They sent you a list of bugs. How do you proceed to fix them?
- medium
TypeScript: Font Size
With this question, you will learn a weird thing about TypeScript that helps with better autocomplete.
- medium
Hooks: useIsMouseMoving
NewFreeCreate a custom hook that tracks the mouse movement. The hook should return a boolean value indicating whether the mouse is moving. The hook should also provide the x and y coordinates of the mouse and update them on mouse move.
- medium
Hooks: useMouse
NewFreeCreate a custom hook that tracks the mouse position. The hook should return the x and y coordinates of the mouse and update them on mouse move, it should also give mouse position relative to a element.
- medium
Hooks: useVolume
NewA generic volume control hook. Can you use it to create a volume control for your music or video player?
- hard
Currying - 1
There are a lot of onChange handlers in this question. How can you make it more readable and maintainable?
- hard
TypeScript: Migrate useVolume
NewRemember our question "Hooks: useVolume" but that was in JavaScript. Try to migrate it to TypeScript.