Skip to content

Commit

Permalink
feat: 브라우저 히스토리 연동을 위한 plugin-history-sync 플러그인 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
2wndrhs committed Feb 2, 2025
1 parent 7981445 commit 1eff577
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"dependencies": {
"@stackflow/core": "^1.1.1",
"@stackflow/plugin-basic-ui": "^1.11.1",
"@stackflow/plugin-history-sync": "^1.7.1",
"@stackflow/plugin-renderer-basic": "^1.1.13",
"@stackflow/react": "^1.4.2",
"@tailwindcss/vite": "^4.0.0",
Expand Down
23 changes: 23 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion src/stackflow.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { basicUIPlugin } from '@stackflow/plugin-basic-ui';
import { historySyncPlugin } from '@stackflow/plugin-history-sync';
import { basicRendererPlugin } from '@stackflow/plugin-renderer-basic';
import { stackflow } from '@stackflow/react';
import CourseSelectionActivity from './pages/CourseSelectionActivity';
Expand All @@ -12,11 +13,18 @@ export const { Stack, useFlow } = stackflow({
basicUIPlugin({
theme: 'cupertino',
}),
historySyncPlugin({
routes: {
OnboardingActivity: '/',
CourseSelectionActivity: '/course-selection',
DesiredCreditActivity: '/desired-credit',
},
fallbackActivity: () => 'OnboardingActivity',
}),
],
activities: {
OnboardingActivity,
CourseSelectionActivity,
DesiredCreditActivity,
},
initialActivity: () => 'OnboardingActivity',
});

0 comments on commit 1eff577

Please sign in to comment.