diff --git a/docs/api-reference/next/streaming.md b/docs/api-reference/next/streaming.md index 210b18c48df3..90b651435677 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 cd2f3fc315b2..941c51bcd9db 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 7caa504a4deb..c79d3c21ecd3 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)