mirror of
https://github.com/wassname/talk.git
synced 2026-06-30 21:47:23 +08:00
Only use Proxy when available
This commit is contained in:
@@ -45,8 +45,10 @@ export function isSlotEmpty(slot, reduxState, props = {}, queryData = {}) {
|
||||
// Memoize the warnings so we only show them once.
|
||||
const memoizedWarnings = [];
|
||||
|
||||
// withWarnings decorates the props of queryData with a proxy that
|
||||
// prints a warning when accessing deeper props.
|
||||
function withWarnings(component, queryData) {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
if (process.env.NODE_ENV !== 'production' && window.Proxy) {
|
||||
|
||||
// Show warnings when accessing queryData only when not in production.
|
||||
return mapValues(queryData, (value, key) => {
|
||||
|
||||
Reference in New Issue
Block a user