Skip to content

Commit

Permalink
build: put ssrContext warning behind __DEV__ flag
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Nov 9, 2022
1 parent f023d49 commit 8dbf083
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/runtime-core/src/helpers/useSsrContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ export const useSSRContext = <T = Record<string, any>>() => {
if (!__GLOBAL__) {
const ctx = inject<T>(ssrContextKey)
if (!ctx) {
warn(
`Server rendering context not provided. Make sure to only call ` +
`useSSRContext() conditionally in the server build.`
)
__DEV__ &&
warn(
`Server rendering context not provided. Make sure to only call ` +
`useSSRContext() conditionally in the server build.`
)
}
return ctx
} else if (__DEV__) {
Expand Down

0 comments on commit 8dbf083

Please sign in to comment.