{"repo":"baruchvlz/resq","free":true,"listed":false,"github":"https://github.com/baruchvlz/resq","clone":"git clone https://github.com/baruchvlz/resq.git","description":"React Element Selector Query (RESQ) - Query React components and children by component name or HTML selector","language":"JavaScript","stars":181,"topics":["react","query","selector"],"license":"MIT","category":"ui-components","readme_excerpt":"resq (React Element Selector Query) Requirements - React v16 or higher - Node 8 or higher - React DevTools (optional) This library tries to implement something similar to querySelector and querySelectorAll , but through the React VirtualDOM. You can query for React composite elements or HTML elements. It provides two functions resq$ and resq$$ for selecting one or multiple components, respectively. Installation Usage To get the most out of the library, we recommend you use React Dev Tools to verify the component names you want to select. Granted for basic usage you don't need this as long as you know the component name beforehand, but for Styled components and MaterialUI components it will be of great help. Type definition Basic Usage Wildcard selection Async selection Filtering selection Basic Usage Take this React App: Selecting MyComponent : Wildcard selection You can select your components by partial name use a wildcard selectors: Selecting both components by wildcard: Selecting MyAnotherComponent by wildcard: Async selection Going by the same example as in basic usage, if you don't want to pass the root element to the function, you can do it this way: Filtering selection You can filter your selections byState or byProps . These are methods attached to the RESQNode return objects. Example app: To select the first instance of MyComponent where someBooleanProp is true: Deep Matching with exact flag If you are in need of filtering byProps or byState and require the filter to","default_branch":null,"files":null,"tree":[],"storefront":"/r/baruchvlz","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/baruchvlz/resq/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}