Iterating routes don't work

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