Skip to content

Instantly share code, notes, and snippets.

@lesagi
lesagi / CRC.sh
Last active October 17, 2020 15:52
This script is used to automatically create react component under "<root_project>/src/components"
#!/usr/bin/bash
# CRC stands for "Create React Component"
# To use, just run CRC.sh <project_root_folder> <component_name>
# The script will automatically create the component in the following
# PATH : <root>/src/components/<component_name>/<component_name>.jsx
# with a basic skeleton in it
mkdir -p ${1}/src/components/${2} && touch ${1}/src/components/${2}/${2}.jsx
cat <<EOT >>./src/components/${2}/${2}.jsx
import React from 'react';