Skip to content

Commit

Permalink
Add custom error message for non-experimental "react" and "react-dom"…
Browse files Browse the repository at this point in the history
… dependencies.
  • Loading branch information
bvaughn committed Dec 15, 2023
1 parent 31233a5 commit 4cec2e4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/suspense/src/cache/createCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ import {
isResolvedRecord,
} from "../utils/isRecordStatus";

if (getCacheForTypeMutable == null) {
throw new Error(
"unstable_getCacheForType is not a function.\n\n" +
"This probably means that the wrong version of React has been specified as a dependency. " +
'The "suspense" package requires the @experimental release of "react" and "react-dom".\n\n' +
"For more information, see https://react.dev/community/versioning-policy#experimental-channel"
);
}

export type InternalCache<Params extends Array<any>, Value> = Cache<
Params,
Value
Expand Down

0 comments on commit 4cec2e4

Please sign in to comment.