Description

Helpful utilities for dealing with getting react information from DOM objects.

Details

Methods


<static> getReactInstance( node ) → {object}

Description

Grabs the react internal instance of a specific node.

Parameters
Name Type Description
node HTMLElement | jQuery

node to obtain react instance of

Returns

the internal react instance


<static> getReactProperty( node, path ) → {*|undefined}

Description

Grabs a value from the react internal instance. Allows you to grab long depth values safely without accessing no longer valid properties.

Parameters
Name Type Description
node HTMLElement | jQuery

node to obtain react instance of

path string

path to the requested value

Returns

the value requested or undefined if not found.


<static> getOwnerInstance( node, options ) → {*|null}

Description

Grabs a value from the react internal instance. Allows you to grab long depth values safely without accessing no longer valid properties.

Parameters
Name Type Description
node HTMLElement | jQuery

node to obtain react instance of

options object

options for the search

Name Type Attributes Default Description
include array <optional>

list of items to include from the search

exclude array <optional>
["Popout", "Tooltip", "Scroller", "BackgroundFlash"]

list of items to exclude from the search

filter callable <optional>
_=>_

filter to check the current instance with (should return a boolean)

Returns

the owner instance or undefined if not found.


<static> getStateNodes( node ) → {Array.<function()>}

Description

Grabs the react internal state node trees of a specific node.

Parameters
Name Type Description
node HTMLElement | jQuery

node to obtain state nodes of

Returns

list of found state nodes


<static> getComponents( node ) → {Array.<function()>}

Description

Grabs the react internal component tree of a specific node.

Parameters
Name Type Description
node HTMLElement | jQuery

node to obtain react components of

Returns

list of found react components


<static> createWrappedElement( element ) → {object}

Description

Creates and renders a react element that wraps dom elements.

Parameters
Name Type Description
element HTMLElement | Array.<HTMLElement>

element or array of elements to wrap into a react element

Returns
  • rendered react element

<static> wrapElement( element ) → {object}

Description

Creates an unrendered react component that wraps dom elements.

Parameters
Name Type Description
element HTMLElement | Array.<HTMLElement>

element or array of elements to wrap into a react component

Returns
  • unrendered react component