score:1

Accepted answer

you're not really nesting anything with a flat list of routes:

<routes>
  <route path="/" element={<main />} />
  <route path="tasks" element={<tasks />} />
  <route path="tasks/comments" element={<comments />} />
</routes>

but there is nothing wrong/incorrect with doing this.

if you wanted to nest the routes you could do so as:

<routes>
  <route path="/" element={<main />} />
  <route path="tasks">
    <route index element={<tasks />} /> // <-- "/tasks"
    <route path="comments" element={<comments />} /> // <-- "/tasks/comments"
  </route>
</routes>

Related Query

More Query from same tag