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.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

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,` +

omi

<p align="center"><img src="https://omijs.github.io/home/assets/logo.svg" alt="omi" width="100"/></p> <h2 align="center">Omi - Web Components Framework</h2>

MIT
Latest version published 18 days ago

Package Health Score

76 / 100
Full package analysis