findbyview
v1.0.2
Published
Getting HTML id and React refs
Downloads
3
Readme
findByView
/**
* @param id Given element or ref
* @param callback HTMLElement or React.RefObject
*
* @description
* Usage
* ```ts
* // Id's
* new findByView("element", (element: HTMLElement) => { element.style.display = "none" })
*
* // Refs
* new findByView(this.myRef, (ref: HTMLElement) => { ref.style.display = "none" })
*
* // Get direclty
* new findByView("element").get?.addEventListener("click", () => thisArgument.click());
* ```
*/