MCPcopy Create free account
hub / github.com/TanStack/hotkeys / TestComponentDelayed

Function TestComponentDelayed

packages/solid-hotkeys/tests/createHotkey.test.tsx:248–267  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

246 // rendering the element with the ref.
247
248 const TestComponentDelayed: Component = () => {
249 const [mounted, setMounted] = createSignal(false)
250 const [target, setTarget] = createSignal<HTMLElement | null>(null)
251 createHotkey('Mod+S', callback, () => ({
252 target: target(),
253 platform: 'mac',
254 }))
255 return (
256 <div>
257 <button
258 type="button"
259 onClick={() => setMounted(true)}
260 data-testid="mount-btn"
261 >
262 Mount
263 </button>
264 {mounted() && <div ref={setTarget} data-testid="target" />}
265 </div>
266 )
267 }
268
269 const { getByTestId } = render(() => <TestComponentDelayed />)
270

Callers

nothing calls this directly

Calls 1

createHotkeyFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…