NavLink->Link, NavButton->Button, remove redirects for now

This commit is contained in:
Ivan Shmidt
2020-06-04 00:03:34 +02:00
parent 6a0daf10ca
commit af56473342
16 changed files with 83 additions and 119 deletions
+1 -13
View File
@@ -10,8 +10,6 @@ addRoute(
options?: RouteOptions,
): void;
addRedirect(from: RouteRef, to: RouteRef, options?: RouteOptions): void;
/**
* @deprecated See the `addRoute` method
*/
@@ -20,26 +18,16 @@ registerRoute(
Component: ComponentType<any>,
options?: RouteOptions,
): void;
/**
* @deprecated See the `addRedirect` method
*/
registerRedirect(
path: RoutePath,
target: RoutePath,
options?: RouteOptions,
): void;
```
## RouteRef
Both `addRoute` and `addRedirect` methods are using mutable RouteRefs, which can be created as following:
`addRoute` method is using mutable RouteRefs, which can be created as following:
```ts
import { createRouteRef } from '@backstage/core';
const myPluginRouteRef = createRouteRef({
icon: () => null, // You can set an icon for your route
path: '/my-plugin',
title: 'My Plugin',
});