DocsAPIcreateElectronRouter

createElectronRouter

Creates a router for your Electron application

The createElectronRouter function creates a router for your Electron application. From it, you will be able to connect the main process and renderer process, allowing integration between them.

Basic example

import { createElectronRouter } from 'electron-router-dom'
 
export const { Router, registerRoute } = createElectronRouter({
  port: 4927,
 
  types: {
    ids: ['main', 'about'],
    queryKeys: ['id', 'name'],
  },
})

API Reference

PropertyTypeDefault

port?

number3000

types?

object

types

PropertyTypeDefault

strict?

booleantrue

ids?

Array<string>

queryKeys?

Array<string>

Return

PropertyType
RouterReact Component
registerRoutefunction
settingsobject