Skip to content

Commit ca84f46

Browse files
committed
chore: add tip about Suspense being experimental
1 parent ded92f9 commit ca84f46

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packages/runtime-core/src/components/Suspense.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,8 @@ export interface SuspenseBoundary {
227227
unmount(parentSuspense: SuspenseBoundary | null, doRemove?: boolean): void
228228
}
229229

230+
let hasWarned = false
231+
230232
function createSuspenseBoundary(
231233
vnode: VNode,
232234
parent: SuspenseBoundary | null,
@@ -239,6 +241,14 @@ function createSuspenseBoundary(
239241
rendererInternals: RendererInternals,
240242
isHydrating = false
241243
): SuspenseBoundary {
244+
/* istanbul ignore if */
245+
if (__DEV__ && !__TEST__ && !hasWarned) {
246+
hasWarned = true
247+
console[console.info ? 'info' : 'log'](
248+
`<Suspense> is an experimental feature and its API will likely change.`
249+
)
250+
}
251+
242252
const {
243253
p: patch,
244254
m: move,

0 commit comments

Comments
 (0)