UNPKG

@chakra-ui/react

Version:

Responsive and accessible React UI components built with React and Emotion

17 lines (14 loc) 448 B
"use strict"; "use client"; import { useMemo } from 'react'; import { useChakraContext } from './provider.js'; function useSlotRecipe(options) { const { key, recipe: recipeProp } = options; const sys = useChakraContext(); return useMemo(() => { if (recipeProp) return sys.sva(recipeProp); if (key != null) return sys.getSlotRecipeFn(key); return sys.sva({ slots: [] }); }, [key, recipeProp, sys]); } export { useSlotRecipe };