MCPcopy Create free account
hub / github.com/dailydotdev/apps / assignRef

Function assignRef

packages/shared/src/components/dropdown/DropdownMenu.tsx:127–133  ·  view source on GitHub ↗
(ref: React.ForwardedRef<T>, node: T | null)

Source from the content-addressed store, hash-verified

125DropdownMenuTrigger.displayName = 'DropdownMenuTrigger';
126
127const assignRef = <T,>(ref: React.ForwardedRef<T>, node: T | null) => {
128 if (typeof ref === 'function') {
129 ref(node);
130 } else if (ref) {
131 Object.assign(ref, { current: node });
132 }
133};
134
135// Content rendered outside a DropdownMenu falls back to its own check.
136export const useDropdownMenuIsPhone = (): boolean => {

Callers 1

DropdownMenu.tsxFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected