A quick shell script function to create a directory following react-style-guide
# React component
rc () {
mkdir $1;
touch "$1/index.js";
echo "import React, { Component } from 'react';
export default class $1 extends Component {
constructor(props) {
super(props);
}
render() {
return (
<div>
</div>
);
}
}" >> "$1/index.js";
}
# React Stateless component
rsc () {
mkdir $1;
touch "$1/index.js";
echo "import React from 'react';
export default ({ prop1 = 'default value' }) => {
return (
<div>
</div>
);
};" >> "$1/index.js";
}