Created
June 21, 2020 01:12
-
-
Save josefaidt/6523f8d75c3cd08d0af87fab105448bd to your computer and use it in GitHub Desktop.
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
function _create_react_component | |
if test (count $argv) -lt 1 | |
read -l -P "Name of component? " component | |
_create_react_component $component | |
else | |
set cmp $argv[1] | |
mkdir -p components/$cmp | |
echo " | |
import React from 'react' | |
import styles from './$cmp.module.css' | |
export default function $cmp({ children, ...rest }) { | |
return ( | |
) | |
} | |
" > components/$cmp/$cmp.js | |
touch components/$cmp/$cmp.module.css | |
echo "export { default } from './$cmp'" > components/$cmp/index.js | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment