MCPcopy Create free account
hub / github.com/ReactTooltip/react-tooltip / BenchmarkFixture

Function BenchmarkFixture

benchmarks/fixture/app.tsx:103–136  ·  view source on GitHub ↗
({ version, count, place }: FixtureState)

Source from the content-addressed store, hash-verified

101}
102
103function BenchmarkFixture({ version, count, place }: FixtureState) {
104 const TooltipComponent = version === 'v5' ? TooltipV5 : TooltipV6
105 const tooltipId = `benchmark-tooltip-${version}`
106
107 const anchorIds = useMemo(
108 () => Array.from({ length: count }, (_, index) => `anchor-${version}-${index}`),
109 [count, version],
110 )
111
112 useEffect(() => {
113 document.body.setAttribute('data-benchmark-count', String(count))
114 document.body.setAttribute('data-benchmark-version', version)
115 }, [count, version])
116
117 return (
118 <div className="benchmark-surface" aria-hidden="true">
119 <div className="anchor-grid">
120 {anchorIds.map((id, index) => (
121 <button
122 key={id}
123 id={id}
124 className="anchor"
125 data-tooltip-id={tooltipId}
126 data-tooltip-content={`Anchor ${index}`}
127 type="button"
128 >
129 {index}
130 </button>
131 ))}
132 </div>
133 <TooltipComponent id={tooltipId} place={place} />
134 </div>
135 )
136}
137
138const rootNode = document.getElementById('root')
139

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected