Unverified Commit e5b88cae authored by Kevin Ang's avatar Kevin Ang Committed by GitHub

fix `revalidateTag` import (#51005)

This PR fixes the erroneous `revalidateTag` import on certain examples.
It was imported from `next/server`, but should be imported from
`next/cache` instead.
Co-authored-by: 's avatarDelba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
parent 8484a6b9
......@@ -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')
......@@ -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')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment