src/actions.js
function waitelem (self, selector, done) {
  let elementPresent
  eval('elementPresent = function() {' + // eslint-disable-line
    `  var 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;' +
    '}')
  waitfn.apply(this, [self, elementPresent, done])
}
function waitelem (self, selector, done) {
  let elementPresent
  eval('elementPresent = function() {' + // eslint-disable-line
    `  var 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;' +
    '}')
  waitfn.apply(this, [self, elementPresent, done])
}
function waitelem ( self , selector , done ) { let elementPresent eval ( 'elementPresent = function() {' + // eslint-disable-line ` ${ 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;' + '}' ) waitfn . apply ( this , [ self , elementPresent , done ] ) }
Wait for a specified selector to exist.

@param {Nightmare} self
@param {String} selector
@param {Function} done
Wait for a specified selector to exist .