Neurological Phenomenon Multiplexer

    @5rabbits/dms

    0.12.3 • Public • Published

    DMS React Component

    Usage

    • Install with yarn add @5rabbits/dms.
    • Install peer dependencies (if you haven't already) yarn add react@^16.0.0 react-dom@^16.0.0 mobx@^3.1.2 mobx-react@^4.3.3. React 15 is also supported.
    • Use the DMS component:
    import DMS from '@5rabbits/dms'
    import '@5rabbits/dms/dist/dms.css'
    
    <DMS
      apiHost="https://my-api.com"
      apiToken="some-auth-token"
    />

    Props

    prop type default required description
    apiHost string yes The host where all requests will be made.
    apiToken string yes The token that will be sent as header Authorization: Bearer TOKEN on every request.
    locale string 'en' Language to display the component. en and es are supported by default, but you can add other languages using the translations prop.
    translations object Extra locales for the component. Use this file as a template and pass the translations as { [locale]: [translations] }.
    routerType memory, browser, hash memory Specifies where the component should persist the inner routing.
    defaultRoute string '/' (memory router only) The initial route the component will render. At the moment you can use:
    • /
    • /files (alias of /)
    • /recent
    • /deleted
    • /(files|recent|deleted)/:itemID (the first segments is used to highlight the corresponding sidebar section)
    onRouteChange func Callback that will be invoked every time the internal route changes. The first argument will be the new route string.
    baseRoute string (browser and hash routers only) The base url segment for browser based routes.
    onError func (React 16 only) Callback that will be invoked if the DMS component crashes and recovers itself. The first argument is the exception and the second one is the React components stack. This is provided for error tracking purposes.

    Install

    npm i @5rabbits/dms

    DownloadsWeekly Downloads

    8

    Version

    0.12.3

    License

    MIT

    Unpacked Size

    486 kB

    Total Files

    6

    Last publish

    Collaborators

    • lemonlet
    • glara
    • rdiaz