Skip to content

Instantly share code, notes, and snippets.

@developit
Created December 4, 2016 19:21
Show Gist options
  • Select an option

  • Save developit/7fda739f5dea675386d6c48ae96af667 to your computer and use it in GitHub Desktop.

Select an option

Save developit/7fda739f5dea675386d6c48ae96af667 to your computer and use it in GitHub Desktop.
import { options } from 'preact';
let old = options.vnode;
options.vnode = vnode => {
if (!vnode.nodeName) throw Error('Undefined component');
old(vnode);
};

Usage

import './preact-throw-on-undefined-components';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment