UNPKG

roko-date-picker

Version:
11 lines (10 loc) 546 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.useStyles = void 0; const react_1 = require("react"); const data_defaults_1 = require("../../domain/data/data.defaults"); const useStyles = (styleFn, theme, ...args) => { // Use useMemo to memoize the styles. Note: We need to use JSON.stringify for the args to ensure useMemo can compare them correctly return (0, react_1.useMemo)(() => styleFn(theme ?? data_defaults_1.defaultTheme, ...args), [args, styleFn, theme]); }; exports.useStyles = useStyles;