From c27377c8f7f8a7609618882908e7a278c5211c95 Mon Sep 17 00:00:00 2001 From: Dillon Kearns Date: Mon, 17 Jan 2022 11:46:40 -0800 Subject: [PATCH] Use dynamic route segments with different names by appending index. --- examples/pokedex/adapter.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/pokedex/adapter.js b/examples/pokedex/adapter.js index a7b698a3..64a59d73 100644 --- a/examples/pokedex/adapter.js +++ b/examples/pokedex/adapter.js @@ -303,13 +303,13 @@ function apiPatternToRedirectPattern(pathPattern) { return ( "/" + pathPattern - .map((segment) => { + .map((segment, index) => { switch (segment.kind) { case "literal": { return segment.value; } case "dynamic": { - return ":dynamic"; // TODO need to assign different names for each dynamic segment? + return `:dynamic${index}`; // TODO need to assign different names for each dynamic segment? } default: { throw "Unhandled segment: " + JSON.stringify(segment);