Skip to content

Commit

Permalink
preact/debug: Allow string refs when preact-compat is present (fixes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
developit committed Aug 24, 2017
1 parent ec80880 commit 99c856d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion debug/index.js
Expand Up @@ -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,` +
Expand Down

0 comments on commit 99c856d

Please sign in to comment.