Created
January 14, 2019 10:07
-
-
Save mifas/8839c42e82d986dc9264927d04c3214d to your computer and use it in GitHub Desktop.
Create React App default code cleanup
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
function craclean(){ | |
rm -rf $1/src/App.js $1/src/App.css $1/src/App.test.js $1/src/index.css $1/src/logo.svg | |
cat << EOS > $1/src/App.js | |
import React, { Component } from 'react' | |
export default class App extends Component { | |
render() { | |
return ( | |
<div> | |
App | |
</div> | |
) | |
} | |
} | |
EOS | |
cat << EOS > $1/src/index.js | |
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import App from './App'; | |
import * as serviceWorker from './serviceWorker'; | |
ReactDOM.render(<App />, document.getElementById('root')); | |
// If you want your app to work offline and load faster, you can change | |
// unregister() to register() below. Note this comes with some pitfalls. | |
// Learn more about service workers: http://bit.ly/CRA-PWA | |
serviceWorker.unregister(); | |
EOS | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment