MCPcopy Index your code
hub / github.com/github/docs / onToggle

Function onToggle

components/sidebar/RestCollapsibleSection.tsx:35–42  ·  view source on GitHub ↗
(e: SyntheticEvent)

Source from the content-addressed store, hash-verified

33 const [visibleAnchor, setVisibleAnchor] = useState('')
34
35 const onToggle = (e: SyntheticEvent) => {
36 const newIsOpen = (e.target as HTMLDetailsElement).open
37 setIsOpen(newIsOpen)
38 sendEvent({
39 type: EventType.navigate,
40 navigate_label: `details ${newIsOpen ? 'open' : 'close'}: ${title}`,
41 })
42 }
43
44 const miniTocItems =
45 router.query.productId === 'rest' ||

Callers

nothing calls this directly

Calls 1

sendEventFunction · 0.90

Tested by

no test coverage detected