Created
August 31, 2019 03:51
-
-
Save TylerLafayette/069d0918dcdf978a1c42f052d885244d to your computer and use it in GitHub Desktop.
A script to quickly generate a React component.
This file contains 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
#! /bin/bash | |
mkdir "$1" | |
printf "export { default } from \"./$1.container\"" > "$1/index.js" | |
printf "import React, { Component } from \"react\"\n\nimport $1 from \"./$1.component\"\n\nexport default class $1Container extends Component {\n\trender = _ => <$1 {...this.props} />\n}" > "$1/$1.container.js" | |
printf "import React, { Component } from \"react\"\n\nimport \"./$1.scss\"\n\nexport default class $1 extends Component {\n\trender = _ => <div></div>\n}" > "$1/$1.component.js" | |
printf "" > "$1/$1.scss" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment