brains
    TypeScript icon, indicating that this package has built-in type declarations

    1.1.3 • Public • Published

    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

    Keywords

    none

    Install

    npm i brains

    DownloadsWeekly Downloads

    13

    Version

    1.1.3

    License

    MIT

    Unpacked Size

    19.9 kB

    Total Files

    10

    Last publish

    Collaborators

    • duanguang