Iterating routes don't work

For some weird reason the code in this image doesn't work as expected
7 Replies
Alex Lohr
Alex Lohr3y ago
map will break solid's reactivity. Better use <For each={routeArray}>
shogun2077
shogun2077OP3y ago
That doesn't work either That was my initial attempt
thetarnav
thetarnav3y ago
it should work fine I think, what's routeArray?
shogun2077
shogun2077OP3y ago
const routes = new Map([['/', HomeComponent]])
const routesArray = Object.entries(routes)
const routes = new Map([['/', HomeComponent]])
const routesArray = Object.entries(routes)
thetarnav
thetarnav3y ago
thetarnav
thetarnav3y ago
it should be like this I guess
shogun2077
shogun2077OP3y ago
Thanks Yup that workds

Did you find this page helpful?