Taogen's Blog

Stay hungry stay foolish.

React Router is a powerful library for routing in React applications. It allows developers to build single-page applications (SPAs) with dynamic navigation and routing capabilities, enabling the display of different components or views based on the current URL. In this post, I will cover how to integrate React Router in a React project.

Read more »

After create a React project by some CLI tools, we need to create some folders to structure the project. React official said they doesn’t have opinions on how you put files into folders. In my personal opinion, I recommend to use the following folder structure.

Read more »

Creating a Dockerfile is a critical part of building container images. Following best practices not only leads to optimized images but also enhances security and maintainability. The following are some best practices to consider when writing your Dockerfile.

Read more »

Naming Conventions

File Names

Component files: Use CamelCase. E.g. MyComponent.js

Non-component files (like helpers, hooks, or utilities): Use kebab-case or camelCase. E.g. useCustomHook.js or myUtility.js.

Custom hooks files: with a use prefix. E.g. useFetch.jsuseForm.js.

Directory Names

Use kebab-case for folder names. E.g. my-foldercomponentsutils.

Test folder name: __tests__

0%