MCPcopy Index your code
hub / github.com/reactstrap/reactstrap / findDOMElements

Function findDOMElements

src/utils.js:285–305  ·  view source on GitHub ↗
(target)

Source from the content-addressed store, hash-verified

283}
284
285export function findDOMElements(target) {
286 if (isReactRefObj(target)) {
287 return target.current;
288 }
289 if (isFunction(target)) {
290 return target();
291 }
292 if (typeof target === 'string' && canUseDOM) {
293 let selection = document.querySelectorAll(target);
294 if (!selection.length) {
295 selection = document.querySelectorAll(`#${target}`);
296 }
297 if (!selection.length) {
298 throw new Error(
299 `The target '${target}' could not be identified in the dom, tip: check spelling`,
300 );
301 }
302 return selection;
303 }
304 return target;
305}
306
307export function isArrayOrNodeList(els) {
308 if (els === null) {

Callers 2

componentDidMountMethod · 0.90
getTargetFunction · 0.85

Calls 2

isReactRefObjFunction · 0.85
isFunctionFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…