Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

resq

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

resq

React Element Selector Query (resq) - Query React components and children by selector (component name)

  • 1.11.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
929K
decreased by-6.68%
Maintainers
1
Weekly downloads
 
Created

What is resq?

The resq npm package is a utility for querying React components in the DOM. It is particularly useful for testing and debugging React applications by allowing developers to locate and interact with React components directly.

What are resq's main functionalities?

Querying React Components

This feature allows you to query a React component by its name. The code sample demonstrates how to use the `resq$` function to find a component named 'MyComponent' and log it to the console.

const resq = require('resq');

(async () => {
  const component = await resq.resq$('MyComponent');
  console.log(component);
})();

Querying Multiple React Components

This feature allows you to query multiple React components by their name. The code sample demonstrates how to use the `resq$$` function to find all components named 'MyComponent' and log them to the console.

const resq = require('resq');

(async () => {
  const components = await resq.resq$$('MyComponent');
  console.log(components);
})();

Querying Components by Props

This feature allows you to query a React component by its props. The code sample demonstrates how to use the `resq$` function to find a component named 'MyComponent' with a specific prop `id` and log it to the console.

const resq = require('resq');

(async () => {
  const component = await resq.resq$('MyComponent', { props: { id: 'unique-id' } });
  console.log(component);
})();

Other packages similar to resq

Keywords

FAQs

Package last updated on 12 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc