React Component Genie creates React or React Native components by simply specifying a file name. It auto-detects the type of project and inserts the correct boilerplate code. Currently supports React, React Native basic and React Native Expo.
Features
Generate React/React-Native components by providing a file name.
Generate components in a specific directory by providing the full path.
Creates a '.tsx' component by default but this can be changed to '.jsx'.
Detects if the project is React or React Native (base or Expo) to create suitable component code.
Automatically detects the presence of 'frontend' folder, to create components inside this folder if it exists.
How To Use
Bring up the command palette by pressing ctrl + shift + p.
Search for 'Create React Component'.
Start typing the name of your component that you wish to create.
Eg. MyComponent
If you wish to create a component in a specific folder, type the entire path.
Eg. src/components/MyComponent
Extension Settings
To change the default extension of your components, open VS Code Settings and search for 'React Component Genie'.
You can choose between the extensions '.tsx' and '.jsx'.
reactComponentGenie.defaultExtension: Set default file extension to 'tsx' or 'jsx'.