Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add use client directive for client components exports #2696

Merged
merged 1 commit into from
Jun 27, 2023
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: 2 additions & 0 deletions core/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

// useSWR
import useSWR from './use-swr'
export default useSWR
Expand Down
2 changes: 2 additions & 0 deletions immutable/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import type { Middleware } from 'swr'
import useSWR from 'swr'
import { withMiddleware } from 'swr/_internal'
Expand Down
2 changes: 2 additions & 0 deletions infinite/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

// We have to several type castings here because `useSWRInfinite` is a special
// hook where `key` and return type are not like the normal `useSWR` types.

Expand Down
2 changes: 2 additions & 0 deletions mutation/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { useCallback, useRef } from 'react'
import useSWR, { useSWRConfig } from 'swr'
import type { Middleware, Key } from 'swr/_internal'
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
"@types/use-sync-external-store": "^0.0.3",
"@typescript-eslint/eslint-plugin": "5.59.8",
"@typescript-eslint/parser": "5.59.8",
"bunchee": "3.4.1",
"bunchee": "3.5.0",
"eslint": "8.42.0",
"eslint-config-prettier": "8.8.0",
"eslint-plugin-jest-dom": "5.0.1",
Expand Down
29 changes: 6 additions & 23 deletions pnpm-lock.yaml

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

2 changes: 2 additions & 0 deletions subscription/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import type { Key, SWRHook, Middleware, SWRConfiguration, SWRConfig } from 'swr'
import type {
SWRSubscriptionOptions,
Expand Down
Loading