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
| Property | Type | Default |
|---|---|---|
| number | 3000 |
| string | |
| object |
types
| Property | Type | Default |
|---|---|---|
| boolean | true |
| Array<string> | |
| Array<string> |
Return
| Property | Type |
|---|---|
| Router | React Component |
| registerRoute | function |
| settings | object |