reactpractice.dev
@reactpractice.dev
Coding challenges to improve your React skills
Spelling mistakes can make your code look unprofessional.

Instead:
- ✅ use lowercase to name your variables (e.g. `match`) and use uppercase for naming your components - e.g. `Accordion`
- ✅ use camelCase when a name is composed of multiple words - e.g. `isLoading`, `MemoryGame`
March 6, 2025 at 8:37 AM
How would you pass the params for this GET request if you wanted them to be configurable?

Checkout the article for the how to use the URLSearchParams API for this!

https://reactpractice.dev/articles/how-to-pass-query-params-to-a-get-request-with-fetch/
March 4, 2025 at 1:52 PM
Did you know "Create React App" is no longer maintained?
Start your React projects with Vite instead!

https://reactpractice.dev/articles/how-setup-a-react-project-with-vite-typescript-and-tailwind/
How setup a React project with Vite, Typescript and Tailwind
reactpractice.dev
March 3, 2025 at 11:00 AM
msw is great for mocking requests when testing your react components.
Do you use it in your projects?
February 28, 2025 at 11:01 AM
Do you think this snippet throws when the server returns HTTP error code 500?
It doesn't! Instead, `fetch` returns the response `ok` property as `false`, and you need to check for that.
February 27, 2025 at 1:52 PM
How do you type a custom hooks that accepts a generic data type?
When using an arrow function, you can add `<T>` at the beginning of the function:
February 26, 2025 at 1:47 PM
Custom hooks are great at abstracting logic.
What are some custom hooks you built in your projects?
February 25, 2025 at 2:56 PM
Just published a new React challenge: build a custom `useFetch` hook starting from failling unit tests!

https://reactpractice.dev/exercise/build-a-custom-usefetch-hook/?utm_source=bluesky&utm_medium=social&utm_campaign=use-fetch-hook
Build a custom useFetch hook
reactpractice.dev
February 20, 2025 at 12:29 PM
Did you work with Swagger before?
It's a great tool for live API documentation. Not all APIs support it, but those that do are great to work with!
Learn how to explore an API using it in the latest article:
https://reactpractice.dev/articles/using-swagger-to-explore-an-api/

Using Swagger to explore an API
reactpractice.dev
February 17, 2025 at 1:47 PM
How do you pass query string params to a GET request with `fetch`? Use the `URLSearchParams` API!
February 13, 2025 at 1:47 PM
Useful tips for anyone currently on the job hunt
February 12, 2025 at 3:22 PM
Wondering how to start a new React app today? Vite is the way to go for learning projects!

https://reactpractice.dev/articles/how-setup-a-react-project-with-vite-typescript-and-tailwind/
How setup a React project with Vite, Typescript and Tailwind
reactpractice.dev
February 12, 2025 at 1:35 PM
Reposted
🎯 useEffect Cleanup Cheatsheet:

• Timers: clearInterval
• Events: removeEventListener
• Subscriptions: unsubscribe
• Connections: disconnect
• API: cancel request

🚀 Why useEffect Cleanup?
No cleanup = Memory leaks
Missing cleanup = Bugs
Bad cleanup = Weird behavior

#ReactJS #javascript
December 29, 2024 at 8:18 PM
What should you expect for you code interview if you have a "Leetcode" style problem to solve? Building a small component, a custom hook or adding a small feature to an app. Check out examples in the latest article 👉

https://reactpractice.dev/articles/leetcode-style-react-problems
Leetcode-style React problems
reactpractice.dev
February 7, 2025 at 11:00 AM
Reposted
Everyone focuses on the "technical" part of technical interviews, but another important thing being evaluated is communication. If you can share your thought process and walk the interviewer through your reasoning, you might pass the interview even if you can’t solve the problem!
Today I had a code interview and I felt better than ever because I started doing pseudocode explaining my chain of thought: a maybe obvious thing, but that I learned its value on the interview section at @joshwcomeau.com 's joy of react. Thanks Josh, to show me how to explaing my thoughts! 💚
February 5, 2025 at 8:55 PM