typeless

typeless

  • Docs
  • API
  • Github

›API Reference (router)

Introduction

  • Quick Start
  • Motivation
  • Examples
  • Starters Kits
  • Roadmap

Using typeless

  • HMR
  • Code-Splitting

API Reference

  • createModule
  • createSelector
  • useActions
  • useMappedState
  • useSelector
  • ChainedReducer
  • Epic
  • Handle
  • Rx

API Reference (router)

  • createUseRouter
  • RouterActions
  • getRouterState
  • Link

API Reference (form)

  • createForm
  • FormActions

createUseRouter(options)

Create a new router module.

Arguments

  1. options: HistoryOptions - the options:
    • type: 'browser' | 'hash' - use browser for html5 navigation, or use hash to keep routing after # in the url. Default browser.

Returns

{Function} - a React hook used to mount the module.

Example

// router.ts
import { createUseRouter } from 'typeless-router';

const useRouter = createUseRouter();

// App.tsx
import { useRouter } from './router';

export function App() {
  // recommended to mount the module in the main component
  useRouter();

  return <div>...</div>
}
← RxRouterActions →
typeless
Docs
Getting StartedAPI Reference
Community
Spectrum
More
GitHub
Copyright © 2020 Łukasz Sentkiewicz