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

fix revalidateTag import #51005

Merged
merged 2 commits into from
Jun 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions docs/02-app/02-api-reference/04-functions/revalidateTag.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ description: API Reference for the revalidateTag function.
`revalidateTag` allows you to revalidate data associated with a specific cache tag. This is useful for scenarios where you want to update your cached data without waiting for a revalidation period to expire.

```tsx filename="app/api/revalidate/route.ts" switcher
import { NextRequest, NextResponse, revalidateTag } from 'next/server'
import { NextRequest, NextResponse } from 'next/server'
import { revalidateTag } from 'next/cache'

export async function GET(request: NextRequest) {
const tag = request.nextUrl.searchParams.get('tag')
Expand All @@ -16,7 +17,8 @@ export async function GET(request: NextRequest) {
```

```jsx filename="app/api/revalidate/route.js" switcher
import { NextResponse, revalidateTag } from 'next/server'
import { NextResponse } from 'next/server'
import { revalidateTag } from 'next/cache'

export async function GET(request) {
const tag = request.nextUrl.searchParams.get('tag')
Expand Down