Skip to content

Instantly share code, notes, and snippets.

@yiminghe
Created December 31, 2014 06:42
Show Gist options
  • Save yiminghe/710f5d34d1a9a789acf9 to your computer and use it in GitHub Desktop.
Save yiminghe/710f5d34d1a9a789acf9 to your computer and use it in GitHub Desktop.
implement alert using rc-dialog
var tmp = document.createElement('div');
document.body.appendChild(tmp);
var React = require('react');
var Dialog = require('rc-dialog');
function alert(str){
var dialog = <Dialog title="alert" visible="true">{str}</Dialog>;
React.render(dialog,tmp);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment