storybook/docs/snippets/react/nextjs-router-push-override-in-preview.js.mdx

22 lines
389 B
Plaintext

```js
// .storybook/preview.js
export default {
// ...
parameters: {
// ...
nextjs: {
router: {
push(...args) {
// Custom logic can go here
// This logs to the Actions panel
action('nextRouter.push')(...args);
// Return whatever you want here
return Promise.resolve(true);
},
},
},
},
};
```