Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions docs/_snippets/tanstack-react-add-framework.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,3 @@ export default defineMain({
+ framework: '@storybook/tanstack-react',
});
```

<!-- JS snippets still needed while providing both CSF 3 & Next -->
2 changes: 0 additions & 2 deletions docs/_snippets/tanstack-react-framework-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,3 @@ export default defineMain({
},
});
```

<!-- JS snippets still needed while providing both CSF 3 & Next -->
2 changes: 0 additions & 2 deletions docs/_snippets/tanstack-react-mock-module-preview.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,3 @@ sb.mock(import('../src/db/client.ts'));

export default definePreview({});
```

<!-- JS snippets still needed while providing both CSF 3 & Next -->
2 changes: 0 additions & 2 deletions docs/_snippets/tanstack-react-mock-server-fn-stories.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,3 @@ export const Failure = meta.story({
},
});
```

<!-- JS snippets still needed while providing both CSF 3 & Next -->
2 changes: 0 additions & 2 deletions docs/_snippets/tanstack-react-plain-component-story.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,3 @@ export const Default = meta.story({
},
});
```

<!-- JS snippets still needed while providing both CSF 3 & Next -->
2 changes: 0 additions & 2 deletions docs/_snippets/tanstack-react-preview-migrate.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,3 @@ export default definePreview({
//...
});
```

<!-- JS snippets still needed while providing both CSF 3 & Next -->
2 changes: 0 additions & 2 deletions docs/_snippets/tanstack-react-query-in-story.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,3 @@ export const LoggedIn = meta.story({
},
});
```

<!-- JS snippets still needed while providing both CSF 3 & Next -->
11 changes: 6 additions & 5 deletions docs/_snippets/tanstack-react-query-setup.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
```tsx filename=".storybook/preview.tsx" renderer="react" language="tsx" tabTitle="CSF 3"
import { type QueryClient, QueryClientProvider } from '@tanstack/react-query';
import type { Preview } from '@storybook/tanstack-react';

// 👇 Create a new QueryClient
const queryClient = new QueryClient({
Expand All @@ -11,15 +12,15 @@ const queryClient = new QueryClient({
},
});

export default {
const preview: Preview = {
beforeEach: () => {
// 👇 Clear the cache between stories so each story starts fresh
queryClient.clear();
},
parameters: {
tanstack: {
router: {
// 👇 Make queryClient available to route loaders via ctx.context.queryClient
// 👇 Make queryClient available in stories' beforeEach via ctx.context.queryClient
context: { queryClient },
},
},
Expand All @@ -33,6 +34,8 @@ export default {
),
],
};

export default preview;
```

```tsx filename=".storybook/preview.tsx" renderer="react" language="tsx" tabTitle="CSF Next 🧪"
Expand All @@ -57,7 +60,7 @@ export default definePreview({
parameters: {
tanstack: {
router: {
// 👇 Make queryClient available to route loaders via ctx.context.queryClient
// 👇 Make queryClient available in stories' beforeEach via ctx.context.queryClient
context: { queryClient },
},
},
Expand All @@ -72,5 +75,3 @@ export default definePreview({
],
});
```

<!-- JS snippets still needed while providing both CSF 3 & Next -->
2 changes: 0 additions & 2 deletions docs/_snippets/tanstack-react-route-story.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,3 @@ export const WithCustomLoader = meta.story({
},
});
```

<!-- JS snippets still needed while providing both CSF 3 & Next -->
2 changes: 0 additions & 2 deletions docs/_snippets/tanstack-react-route-tree-overrides.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,3 @@ const meta = preview.meta({

export const Default = meta.story();
```

<!-- JS snippets still needed while providing both CSF 3 & Next -->
Loading