Skip to content

Instantly share code, notes, and snippets.

@nishantrpai
Last active February 8, 2018 06:26
Show Gist options
  • Save nishantrpai/bdec3f6e1192137bc848eccf979c9002 to your computer and use it in GitHub Desktop.
Save nishantrpai/bdec3f6e1192137bc848eccf979c9002 to your computer and use it in GitHub Desktop.
component=$1
echo "export {$component} from './$component';" >> index.js
echo "@import './$component/style.css';" >> index.css
mkdir $component
cd $component
touch index.js
touch style.css
touch $component.js
echo "export { default as $component } from './$component';" >> index.js
COMPONENTFILE="import React from \"react\";
\nimport PropTypes from \"prop-types\";
\nimport { connect } from \"react-redux\";
\nconst $component = () => (
\n <p> Hello World!</p>
\n);
\n\nexport default $component;
"
echo $COMPONENTFILE >> $component.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment