recursive function improvement
Avoid recursion, avoid putting the accumulator out of the function that fills it.

My favourite phrase: Every recursive algorithm can be rewritten without recursion. In worst case, using one (extra) stack.

function renderRoutes(menuItems) {
  let accumulator = [];
  let queue = [];
  queue.concat(menuItems);
  while (queue.length &gt; 0) {
    const item = queue.shift();
    accumulator.push(route(item))
    queue.concat(item.children);
  }
  return accumulator;
}


The route(item) is the same as your &lt;Route....