app,create-app: migrate to relative tab routes

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-03-25 17:11:49 +01:00
parent 8f363363b8
commit c1f1a4c760
4 changed files with 85 additions and 58 deletions
+27
View File
@@ -0,0 +1,27 @@
---
'@backstage/create-app': patch
---
Updated the entity page routes to use relative routes rather than absolute ones. This change is required to be able to upgrade to `react-router` v6 stable in the future.
To apply this change to an existing app, update the path prop of `EntityLayout.Route`s to be relative. For example:
```diff
<EntityLayoutWrapper>
- <EntityLayout.Route path="/" title="Overview">
+ <EntityLayout.Route path="." title="Overview">
{overviewContent}
</EntityLayout.Route>
- <EntityLayout.Route path="/ci-cd" title="CI/CD">
+ <EntityLayout.Route path="ci-cd" title="CI/CD">
{cicdContent}
</EntityLayout.Route>
- <EntityLayout.Route path="/errors" title="Errors">
+ <EntityLayout.Route path="errors" title="Errors">
{errorsContent}
</EntityLayout.Route>
```
This change should also be applied to any other usage of `TabbedLayout`.