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

Function assignRef

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

Source from the content-addressed store, hash-verified

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

Callers 1

DropdownMenu.tsxFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected