Skip to content

CSUI routing #1025

Answered by peguimasid
detronetdip asked this question in Q&A
Jul 16, 2024 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

You can use the MemoryRouter feature from react-router-dom to handle routing efficiently in your CSUI.

Here's an example of how you can set it up:

import { MemoryRouter, Route, Routes } from 'react-router-dom'

import { Main } from '@/pages/main'
import { Protocols } from '@/pages/protocols'

export const Router = () => {
  return (
    <MemoryRouter>
      <Routes>
        <Route path="/" element={<Main />} />
        <Route path="/protocols" element={<Protocols />} />
      </Routes>
    </MemoryRouter>
  )
}

I used this repository as an example: https://github.com/Repyah84/wisher

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@detronetdip
Comment options

@peguimasid
Comment options

@detronetdip
Comment options

Answer selected by detronetdip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants