Last active
October 17, 2020 15:52
-
-
Save lesagi/7f7fbf9f3aa349be39ca6a2529095ac4 to your computer and use it in GitHub Desktop.
This script is used to automatically create react component under "<root_project>/src/components"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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'; | |
const ${2} = () => { | |
} | |
export default ${2}; | |
EOT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment