Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Create React componentNew to Visual Studio Code? Get it now.
Create React component

Create React component

gfpacheco

|
370 installs
| (1) | Free
Create React component folder and files from explorer context menu
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Create React component

Helper extension to generate react components my way.

How it works

Right-click the parent folder and select "Create React component" (or "Create React Native component").

Input the component name (e.g. "MyComponent").

The extension will create a file sctructure like this inside the parent folder:

└ MyComponent
  ├ index.js
  └ MyComponent.js

With the following content:

index.js

export * from './MyComponent';
export { default } from './MyComponent';

MyComponent.js

import React from 'react';
import classNames from 'classnames';

function MyComponent({ className, ...rest }) {
  return <div className={classNames(className)} {...rest} />;
}

export default MyComponent;

Or if you created a React Native component:

import React from 'react';
import { StyleSheet, View } from 'react-native';

function MyComponent({ style, ...rest }) {
  return <View style={[style, styles.root]} {...rest} />;
}

const styles = StyleSheet.create({
  root: {},
});

export default MyComponent;

Enjoy!

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft