diff --git a/docs/api-reference/next/streaming.md b/docs/api-reference/next/streaming.md index 210b18c48df36..90b6514356772 100644 --- a/docs/api-reference/next/streaming.md +++ b/docs/api-reference/next/streaming.md @@ -88,6 +88,8 @@ export default function Search() { { refresh() + // Or refresh with updated props: + // refresh(nextProps) }} /> ) diff --git a/packages/next/client/index.tsx b/packages/next/client/index.tsx index cd2f3fc315b2e..941c51bcd9dbe 100644 --- a/packages/next/client/index.tsx +++ b/packages/next/client/index.tsx @@ -808,7 +808,7 @@ if (process.env.__NEXT_RSC) { const startTransition = (React as any).startTransition const rerender = () => dispatch({}) // If there is no cache, or there is serialized data already - function refreshCache(nextProps: any) { + function refreshCache(nextProps?: any) { startTransition(() => { const currentCacheKey = getCacheKey() const response = createFromFetch( diff --git a/packages/next/client/streaming/refresh.ts b/packages/next/client/streaming/refresh.ts index 7caa504a4deb3..c79d3c21ecd32 100644 --- a/packages/next/client/streaming/refresh.ts +++ b/packages/next/client/streaming/refresh.ts @@ -1,6 +1,6 @@ import { createContext, useContext } from 'react' -export const RefreshContext = createContext((_: any) => {}) +export const RefreshContext = createContext((_props?: any) => {}) export function useRefreshRoot() { return useContext(RefreshContext)