How to use the options function from preact
Find comprehensive JavaScript preact.options code examples handpicked from public code repositorys.
The preact.options object provides global configuration options for the Preact library.
0 1 2 3 4 5 6 7 8 9
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.forwardRef = exports.REACT_FORWARD_SYMBOL = void 0; var preact_1 = require("preact"); var util_1 = require("./util"); var oldDiffHook = preact_1.options._diff; preact_1.options._diff = function (vnode) { if (vnode.type && vnode.type._forwarded && vnode.ref) { vnode.props.ref = vnode.ref; vnode.ref = null;
4
7
0
526 527 528 529 530 531 532 533 534 535
var t, u, r, o = 0, i = [], c = _preact.options.__b, f = _preact.options.__r, e = _preact.options.diffed, a = _preact.options.__c, v = _preact.options.unmount;
0
0
1
+ 104 other calls in file
How does preact.options work?
preact.options
is an object that holds various options for configuring the behavior of the Preact library, such as debounceRendering
which specifies whether Preact should debounce its rendering cycles or not.
20 21 22 23 24 25 26 27 28 29
} // HACKS... // TODO: lock version // TODO: link gh issues function flushToDom() { var oldDebounceRendering = preact.options.debounceRendering; // orig var callbackQ = []; function execCallbackSync(callback) { callbackQ.push(callback); }
0
0
0
+ 17 other calls in file
Ai Example
1 2
import { options } from "preact"; options.debounceRendering = true;
preact.options is the most popular function in preact (790 examples)