hake
The minimal configurations for a Redux based React App powered by TypeScript
This package include the following packages, the main idea is reuse these configurations in multiple projects.
"dependencies": "@types/react": "^15.0.9" "@types/react-dom": "^0.14.23" "@types/react-redux": "^4.4.36" "@types/react-router": "^3.0.3" "@types/react-router-redux": "^4.0.40" "@types/redux-immutable": "^3.0.33" "immutable": "^3.8.1" "react": "^15.4.2" "react-dom": "^15.4.2" "react-redux": "^5.0.2" "react-router": "^3.0.2" "react-router-redux": "^4.0.8" "redux": "^3.6.0" "redux-immutable": "^3.1.0" "hake-redux": "^0.0.5"
Table of Contents
Install
npm i hake -S # or yarn add hake
https://github.com/wmonk/create-react-app-typescript
Get started in seconds with- Create your awesome app using
create-react-app my-app --scripts-version=react-scripts-ts
- Start up a local server
cd my-app yarn start
Now you have a react app running at http://localhost:3000/
- Add hake support
yarn add hake
modify index.tsx
to:
-import * as React from 'react';-import * as ReactDOM from 'react-dom'; import App from './App'; import './index.css'; -ReactDOM.render(- <App />,- document.getElementById('root') as HTMLElement-);+import hake from 'hake'+ +// your routes configurations or+// a function please read the source code get more informations+ +const routes = [{+ path: '/',+ component: App+}]+ +const app = hake({ routes })+ +app.start()
Thats it, now you have a running react app but with redux react-router supported.
Usage
// your routes configurations or // a function please read the source code get more informations app.start
For more informations please read the source file take a look.
// all options list here /** * configure routes and others then start the app immediately * @param */declare ;;
Contribute
This package is used for special project, if you want use it in your project just clone it.
License
MIT © bang88