@aomi/mobx-history
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

Mobx history

Mobx react-router-dom

快速开始

安装

yarn install history @aomi/mobx-history

React Router 使用

import { createHashHistory } from 'history';

const history = syncHistory(createHashHistory());

const App = (
  <Router history={history}>
  </Router>
)

Api

import { navigationServices } from '@aomi/mobx-history';

export interface Location<S = LocationState> {
  pathname: Pathname;
  search: Search;
  state: S;
  hash: Hash;
  key?: LocationKey;
}

const location:Location = {}
// 进入指定页面
navigationServices.push(location)

// 替换当前页面
navigationServices.replace('/login');

Dependencies (0)

    Dev Dependencies (3)

    Package Sidebar

    Install

    npm i @aomi/mobx-history

    Weekly Downloads

    0

    Version

    1.0.4

    License

    MIT

    Unpacked Size

    6.18 kB

    Total Files

    11

    Last publish

    Collaborators

    • sean-tian
    • happysuns