Cool VSCode Extensions that that I've discovered
Tags: webdev, react, tutorial, vscode
Published: 2024-06-12 08:07:12

Recently, I revisited a React side project that I had abandoned last year. In doing so, I discovered some essential VSCode extensions that have significantly enhanced my productivity as a React developer. The only rule for this list is that all these extensions are **React specific**. While they might be useful for other purposes, their main focus is React.

So, let's dive in.

![Let's go](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/opxot6h4u0sxgm9zp3yq.gif)

---

These extensions will help by providing you with snippets. **_Snippets_** are predefined pieces of code that can expand into a complete code block with a single keystroke (_pressing the tab key in most cases_). These snippets can range from a single line to an entire file. By using snippets, you can condense whole files into a short abbreviation, making your coding experience much smoother.

### **1. ES7 React/Redux/GraphQL/React-Native Snippets**

![ES7](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iqxpf64yy8a7zpfcpgcg.png)

This [extension](https://marketplace.visualstudio.com/items?itemName=dsznajder.es7-react-js-snippets) provides a comprehensive collection of snippets for React, Redux, GraphQL, and React Native. These snippets can significantly speed up your development process by allowing you to quickly generate commonly used code structures. For example:

- `rcc` creates a React class component skeleton.
- `rfc` generates a React functional component.
- `rnfce` snippets help you quickly set up React Native component with default export.
* _The list is endless_ . Explore [here](https://github.com/r5n-dev/vscode-react-javascript-snippets/blob/HEAD/docs/Snippets.md)

These snippets are highly customizable and cover a wide range of use cases, making your development more efficient.

### **2. React Hooks Snippets**

![hooks](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5ulwbak9qamtc3846llm.png)

The [React Hooks](https://marketplace.visualstudio.com/items?itemName=AlDuncanson.react-hooks-snippets) snippet extension simplifies the addition of hooks in React by providing specific abbreviations:

- `ush` for `useState` initializes a state variable.
- `ueh` for `useEffect` sets up a side effect.
- `uch` for `useContext` accesses a context.

This extension is particularly useful because it focuses on React's hooks API, which is a core feature for functional components. It helps you quickly implement hooks without having to remember the exact syntax every time.

### **3. VSCode React Refactor**

![refactor](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tucj03fncc4btoltsxm4.png)

[VSCode React Refactor](https://marketplace.visualstudio.com/items?itemName=planbcoding.vscode-react-refactor) allows you to refactor your code by extracting parts of it into separate components. This can be particularly useful when your component becomes too large and you want to break it down into smaller, more manageable pieces. For example:

- Select a piece of JSX code.
- Right-click and choose "Refactor".
- Extract it into a new component.

This extension supports TypeScript and ensures that your extracted components are correctly imported and used, streamlining your refactoring process.

### **4. Paste JSON as Code**

![json](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cflc9kcid3tvfitmlzg8.png)

[Paste JSON as Code] (https://marketplace.visualstudio.com/items?itemName=quicktype.quicktype) allows you to convert JSON objects into code. This is especially useful when dealing with APIs that return JSON responses. For instance:

- Copy a JSON object.
- Use the command palette to choose "Paste JSON as Code".
- Convert the JSON into JavaScript or TypeScript code with type definitions.

This extension helps in quickly transforming JSON data into usable code structures, saving time and reducing errors.

### **5. SVG Gallery**

![svg](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3ioelbe4mk13mk7y2ld0.png)

[SVG Gallery] (https://marketplace.visualstudio.com/items?itemName=developer2006.svg-gallery) is an excellent tool for managing SVG files in your projects. It allows you to preview SVG files directly in VSCode, which can be particularly handy when dealing with multiple SVG assets. Features include:

- Preview SVGs within the editor.
- Copy SVG content as React components.
- Organize and manage your SVG assets efficiently.

This extension simplifies the process of working with SVG files, making it easier to integrate and manage vector graphics in your React projects.

---

While the above recommendations come from my subjective point of view and personal experience with these extensions, I urge you to install and experience them yourself. Each developer has unique needs and workflows, and these extensions might fit differently into your projects.

I encourage you to share some of the cool extensions that have enhanced your productivity. Remember, these are not the only extensions out there, and I'm always on the lookout for new tools to improve my workflow.

_This brings us to a thought-provoking question: **Are we creating lazy programmers by relying heavily on these extensions, or are we genuinely enhancing productivity and efficiency?** Share your thoughts and experiences. Let’s discuss whether these tools are crutches or catalysts for better development._

Until next time!......

![cheers](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ruau6ij81iaqqoyjlzm1.jpeg)