mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 03:21:49 +08:00
- Add missing filenames or titles to snippets - Proper capitalization of terms like Webpack, Babel, PostCSS, etc. - Fix some typos - Split up complex snippets - Document default parameter values - Move acknowledgements back to README
30 lines
641 B
Plaintext
30 lines
641 B
Plaintext
```ts
|
|
// RouterBasedComponent.stories.ts
|
|
import { Meta, StoryObj } from '@storybook/react';
|
|
|
|
import RouterBasedComponent from './RouterBasedComponent';
|
|
|
|
const meta: Meta<typeof RouterBasedComponent> = {
|
|
component: RouterBasedComponent,
|
|
};
|
|
export default meta;
|
|
|
|
type Story = StoryObj<typeof RouterBasedComponent>;
|
|
|
|
// If you have the actions addon,
|
|
// you can interact with the links and see the route change events there
|
|
export const Example: Story = {
|
|
parameters: {
|
|
nextjs: {
|
|
router: {
|
|
pathname: '/profile/[id]',
|
|
asPath: '/profile/1',
|
|
query: {
|
|
id: '1',
|
|
},
|
|
},
|
|
},
|
|
},
|
|
};
|
|
```
|