New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

brains

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

brains

React Framework

latest
Source
npmnpm
Version
1.1.3
Version published
Maintainers
1
Created
Source

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

FAQs

Package last updated on 28 Mar 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts