build: put ssrContext warning behind __DEV__ flag
This commit is contained in:
parent
f023d49a49
commit
8dbf083133
|
@ -7,10 +7,11 @@ export const useSSRContext = <T = Record<string, any>>() => {
|
||||||
if (!__GLOBAL__) {
|
if (!__GLOBAL__) {
|
||||||
const ctx = inject<T>(ssrContextKey)
|
const ctx = inject<T>(ssrContextKey)
|
||||||
if (!ctx) {
|
if (!ctx) {
|
||||||
warn(
|
__DEV__ &&
|
||||||
`Server rendering context not provided. Make sure to only call ` +
|
warn(
|
||||||
`useSSRContext() conditionally in the server build.`
|
`Server rendering context not provided. Make sure to only call ` +
|
||||||
)
|
`useSSRContext() conditionally in the server build.`
|
||||||
|
)
|
||||||
}
|
}
|
||||||
return ctx
|
return ctx
|
||||||
} else if (__DEV__) {
|
} else if (__DEV__) {
|
||||||
|
|
Loading…
Reference in New Issue