Skip to content

Commit 9008aa8

Browse files
committed
Fix type issue with the latest frontend-shared version
In the latest version of the frontent-shared package, `extraRoute` has a mandatory property `group` that must be either `"home" | "foundations" | "patterns" | "components"`; There are three ways to fix this: * make the `group` property optional in the frontend-shared package (I don't know if that's a good idea). * cast the `string` type to the one of the allowed types: ` group: /** @type {'components'} */ ('components'),` * convert the `string` type to const without casting (this PR).
1 parent 223f329 commit 9008aa8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

dev-server/ui-playground/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@ import ButtonPatterns from './components/ButtonPatterns';
33

44
import sidebarIcons from '../../src/sidebar/icons';
55

6+
/** @type {import('@hypothesis/frontend-shared/lib/pattern-library').PlaygroundRoute['group']} */
7+
const components = 'components';
8+
69
const extraRoutes = [
710
{
811
route: '/buttons',
912
title: 'Buttons',
1013
component: ButtonPatterns,
14+
group: components,
1115
},
1216
];
1317

0 commit comments

Comments
 (0)