How to use the omi.options function in omi

To help you get started, we’ve selected a few omi examples, based on popular ways it is used in public projects.

github Tencent / omi / packages / templates-old / reomi / debug / index.js View on Github external
/* eslint-disable no-console */

if (process.env.NODE_ENV === 'development') {
	const omi = require('omi');
	const options = omi.options;
	const oldVnodeOption = options.vnode;

	options.vnode = function(vnode) {
		const { nodeName, attributes, children } = vnode;

		if (nodeName === void 0) {
			console.error('Undefined component passed to omi.h()\n'+serializeVNode(vnode));
		}

		if (
			attributes && attributes.ref !== void 0 &&
			typeof attributes.ref !== 'function' &&
			!('$$typeof' in vnode)  // allow string refs when omi-compat is installed
		) {
			throw new Error(
				`Component's "ref" property should be a function,` +