import React from 'react'; import {Button, InputGroup, Input, InputGroupAddon} from 'reactstrap'; class Preview extends React.Component { constructor(props) { super(props); this.state = { previewUrl: `${window.location.protocol}//${window.location.host}/` }; } handlePreviewUrlChange(ev) { this.setState({previewUrl: ev.target.value}); } handlePreviewChange(ev) { try { let url = ev.target.contentWindow.location.toString(); this.setState({previewUrl: url}); } catch(e) {} } handlePreviewGo() { this.previewIframe.src = this.state.previewUrl; } render() { return (
this.handlePreviewUrlChange(e)} />
); } } export default Preview;