Skip to content

Commit

Permalink
chore: add tip about Suspense being experimental
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Apr 24, 2020
1 parent ded92f9 commit ca84f46
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/runtime-core/src/components/Suspense.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ export interface SuspenseBoundary {
unmount(parentSuspense: SuspenseBoundary | null, doRemove?: boolean): void
}

let hasWarned = false

function createSuspenseBoundary(
vnode: VNode,
parent: SuspenseBoundary | null,
Expand All @@ -239,6 +241,14 @@ function createSuspenseBoundary(
rendererInternals: RendererInternals,
isHydrating = false
): SuspenseBoundary {
/* istanbul ignore if */
if (__DEV__ && !__TEST__ && !hasWarned) {
hasWarned = true
console[console.info ? 'info' : 'log'](
`<Suspense> is an experimental feature and its API will likely change.`
)
}

const {
p: patch,
m: move,
Expand Down

0 comments on commit ca84f46

Please sign in to comment.