How to do CSUI routing?

I'm trying to build a chrome extension with plasmo, I' using the cs ui for my extension, now my extension will have multiple pages like initially there will be welcome page then clicking on a button will lead to a diffrent page like that. but I don't know how to do this kind of routing efficiently in CSUI currently i'm using the below approch, which will get out of hand if I add more and more pages, and it is very dificult for complex routing as well. Can someone please help me with any suggesition or something?
const App=()=>{
const [page,setPage]=useState(1);
return (
<>
{
page===1?<Page1 setPage={setPage}/> :
page===2?<Page2 setPage={setPage}/> : <NotFound/>
}
</>
)

}
const App=()=>{
const [page,setPage]=useState(1);
return (
<>
{
page===1?<Page1 setPage={setPage}/> :
page===2?<Page2 setPage={setPage}/> : <NotFound/>
}
</>
)

}
I have created a github discussion as well https://github.com/PlasmoHQ/plasmo/discussions/1025#discussion-6940304
GitHub
CSUI routing · PlasmoHQ plasmo · Discussion #1025
I'm trying to build a chrome extension with plasmo, I' using the cs ui for my extension, now my extension will have multiple pages like initially there will be welcome page then clicking on...
2 Replies
Arcane
Arcane•6mo ago
@Ayondip has reached level 1. GG!
Ayondip
AyondipOP•6mo ago
can anyone please help?
Want results from more Discord servers?
Add your server