src/actions.js
function (selector, done) {
  this.evaluate_now((selector) => {
    let element = document.querySelector(selector)
    if (!element) {
      return null
    }

    for (let key in element) {
      if (key.startsWith('__reactInternalInstance$')) {
        const compInternals = element[key]._currentElement
        const compWrapper = compInternals._owner
        const {props, state, context} = compWrapper._instance
        return {
          props,
          state,
          context
        }
      }
    }

    return null
  }, done, selector)
}
function (selector, done) {
  this.evaluate_now((selector) => {
    let element = document.querySelector(selector)
    if (!element) {
      return null
    }

    for (let key in element) {
      if (key.startsWith('__reactInternalInstance$')) {
        const compInternals = element[key]._currentElement
        const compWrapper = compInternals._owner
        const {props, state, context} = compWrapper._instance
        return {
          props,
          state,
          context
        }
      }
    }

    return null
  }, done, selector)
}
function ( selector , done ) { this . evaluate_now ( ( selector ) => { let element = document . querySelector ( selector ) if ( ! element ) { return null } for ( let key in element ) { if ( key . startsWith ( '__reactInternalInstance$' ) ) { const compInternals = element [ key ] . _currentElement const compWrapper = compInternals . _owner const { props , state , context } = compWrapper . _instance return { props , state , context } } } return null } , done , selector ) }
Find react element by selector and return his values

@param {String} selector
@param {Function} done
@return {{state: Object, props: Object, context: Object}}
Find react element by selector and return his values