Menu icon Foundation
Reveal Modal Overlay leave react node

Hi 

I have this code

 

class ZfConfirmModal extends Component {

    constructor(props) {

        super(props);

        this.reveal = null;

    }

    componentDidMount() {

		this.reveal = new Foundation.Reveal($('#'+this.props.id));

		this.reveal.open();

}

var AlertModal = function(options) {
  var cleanup, component, props, wrapper;
  

  if (options == null) {

    options = {};

  }

  props = $.extend({}, options);

  wrapper = document.body.appendChild(document.createElement('div'));

  wrapper.className = "reveal-overlay"

  component = ReactDOM.render(<ZfConfirmModal {...props}/>, wrapper);

  cleanup = function() {

  	//

    if (ReactDOM.unmountComponentAtNode(wrapper)){

       document.body.removeChild(wrapper);

    }

  };



  return component.promise.always(cleanup).promise();

}

After run this.reveal.open();  modal showed but component moved (append to body) and component lost root node (wrapper) -  how call open() without move ?
http://clip2net.com/s/3Degy4D

 

Reveal react

Hi 

I have this code

 

class ZfConfirmModal extends Component {

    constructor(props) {

        super(props);

        this.reveal = null;

    }

    componentDidMount() {

		this.reveal = new Foundation.Reveal($('#'+this.props.id));

		this.reveal.open();

}

var AlertModal = function(options) {
  var cleanup, component, props, wrapper;
  

  if (options == null) {

    options = {};

  }

  props = $.extend({}, options);

  wrapper = document.body.appendChild(document.createElement('div'));

  wrapper.className = "reveal-overlay"

  component = ReactDOM.render(<ZfConfirmModal {...props}/>, wrapper);

  cleanup = function() {

  	//

    if (ReactDOM.unmountComponentAtNode(wrapper)){

       document.body.removeChild(wrapper);

    }

  };



  return component.promise.always(cleanup).promise();

}

After run this.reveal.open();  modal showed but component moved (append to body) and component lost root node (wrapper) -  how call open() without move ?
http://clip2net.com/s/3Degy4D