From 99c856d4e620e5c8e4e720765b5b01c60b3c8535 Mon Sep 17 00:00:00 2001 From: Jason Miller Date: Thu, 24 Aug 2017 11:14:33 -0400 Subject: [PATCH] preact/debug: Allow string refs when preact-compat is present (fixes #807) --- debug/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/debug/index.js b/debug/index.js index b35cb70743..eb05700d74 100644 --- a/debug/index.js +++ b/debug/index.js @@ -11,7 +11,8 @@ if (process.env.NODE_ENV === 'development') { if ( attributes && attributes.ref !== void 0 && - typeof attributes.ref !== 'function' + typeof attributes.ref !== 'function' && + !('$$typeof' in vnode) // allow string refs when preact-compat is installed ) { throw new Error( `Component's "ref" property should be a function,` +