1.1.3 • Published 3 years ago
brains v1.1.3
brains
react 应用注册及启动
use
// App.tsx
import { Route, Switch } from 'legions/router';
import React from 'react';
export default class App extends React.Component {
render() {
return (
<Switch>
<React.Fragment>{this.props.children}</React.Fragment>
</Switch>
);
}
}
// 入口文件 main.ts
import create from 'brains';
import App from './App';
import { createHashHistory, createBrowserHistory, createMemoryHistory } from 'history';
const app = create(options);
app.start(App, '#react-app');
options
- enableDevTools : boolean
开启mobx 调试插件
- history : createHashHistory|createBrowserHistory|createMemoryHistory
路由类型,默认createHashHistory
- router : boolean
是否开启路由,此参数多余,历史原因考虑不周,逐步废弃,传入即可,不必过分关注
Licensing
MIT license
1.1.1
3 years ago
1.1.3
3 years ago
1.1.2
3 years ago
1.1.0
4 years ago
1.0.3-beta.1
5 years ago
0.1.10-beta.2
5 years ago
1.0.3-beta
5 years ago
1.0.3
6 years ago
1.0.2
6 years ago
1.0.0
6 years ago
0.1.9
6 years ago
0.1.8
6 years ago
0.1.5
6 years ago
0.1.4
6 years ago
0.1.3
6 years ago
0.1.2
6 years ago
0.1.1
6 years ago
0.1.0
6 years ago
0.0.12
8 years ago
0.0.11
8 years ago
0.0.10
8 years ago
0.0.9
8 years ago
0.0.8
8 years ago
0.0.7
8 years ago
0.0.6
8 years ago
0.0.5
8 years ago
0.0.4
8 years ago
0.0.3
8 years ago
0.0.2
8 years ago
0.0.1
8 years ago
0.0.0
14 years ago