forked from imbytecat/fullstack-starter
fix(server): 避免 SSR 导入 *.client 模块导致构建失败
This commit is contained in:
@@ -54,7 +54,7 @@ bun test -t "pattern" # Run tests matching pattern
|
||||
```
|
||||
src/
|
||||
├── client/ # Client-side code
|
||||
│ ├── orpc.client.ts # ORPC isomorphic client
|
||||
│ ├── orpc.ts # ORPC isomorphic client
|
||||
│ └── query-client.ts # TanStack Query client
|
||||
├── components/ # React components
|
||||
├── routes/ # TanStack Router file routes
|
||||
@@ -119,7 +119,7 @@ export const router = os.router({ feature })
|
||||
### 4. Use in Components
|
||||
```typescript
|
||||
import { useSuspenseQuery, useMutation } from '@tanstack/react-query'
|
||||
import { orpc } from '@/client/orpc.client'
|
||||
import { orpc } from '@/client/orpc'
|
||||
|
||||
const { data } = useSuspenseQuery(orpc.feature.list.queryOptions())
|
||||
const mutation = useMutation(orpc.feature.create.mutationOptions())
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { createTanstackQueryUtils } from '@orpc/tanstack-query'
|
||||
import { orpc as orpcClient } from './orpc.client'
|
||||
import { orpc as orpcClient } from './orpc'
|
||||
|
||||
export const orpc = createTanstackQueryUtils(orpcClient, {
|
||||
experimental_defaults: {
|
||||
|
||||
Reference in New Issue
Block a user