@chakra-ui/react
Version:
Responsive and accessible React UI components built with React and Emotion
19 lines (15 loc) • 480 B
JavaScript
;
"use client";
;
var React = require('react');
var provider = require('./provider.cjs');
function useSlotRecipe(options) {
const { key, recipe: recipeProp } = options;
const sys = provider.useChakraContext();
return React.useMemo(() => {
if (recipeProp) return sys.sva(recipeProp);
if (key != null) return sys.getSlotRecipeFn(key);
return sys.sva({ slots: [] });
}, [key, recipeProp, sys]);
}
exports.useSlotRecipe = useSlotRecipe;