Create TSX Component VSCode Extension
A simple VSCode extension to quickly create React TypeScript components with styled-components .
Features
- Quickly generate a new
.tsx component file
- Includes a basic structure with:
styled-components styling
- TypeScript
Props interface
- Default component export
- Prevents overwriting existing files
Usage
- Open the command palette (
Mac: Cmd+Shift+P , Windows/Linux: Ctrl+Shift+P )
- Search for
Create TSX Component
- Enter the name of the component
- A
.tsx file will be created in the root of your workspace with the following template:
import React from "react";
import styled from "styled-components";
const ComponentNameStyled = styled.div``;
interface ComponentNameProps {}
const ComponentName = () => {
return <ComponentNameStyled></ComponentNameStyled>;
};
export default ComponentName;
Note: If a file with the same name already exists, an error message will be displayed.
License
MIT
| |