Skip to content

Commit 2964908

Browse files
0618zhamujun
andauthored
chore(docs): refactor useCustomRouter to use FRAMEWORKS (#1974)
Co-authored-by: MJ☔ <[email protected]>
1 parent f208f2e commit 2964908

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/src/components/useCustomRouter.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as React from 'react';
22

33
import { useRouter } from 'next/router';
4+
import { FRAMEWORKS } from '@/data/frameworks';
45

56
/**
67
*
@@ -15,10 +16,9 @@ export const useCustomRouter = () => {
1516
query: { platform = 'react' },
1617
push,
1718
} = router;
18-
const platforms = ['react', 'angular', 'vue', 'flutter'];
1919

2020
React.useEffect(() => {
21-
if (!platforms.includes(platform.toString())) {
21+
if (!FRAMEWORKS.includes(platform.toString())) {
2222
push('/404');
2323
}
2424
}, [platform]);

0 commit comments

Comments
 (0)