Add deprecation warning for onrendered (Fix #1290)

This commit is contained in:
Niklas von Hertzen 2017-12-07 15:47:42 +08:00
parent 166cbba7c2
commit b8178e92b4

View File

@ -39,6 +39,12 @@ const html2canvas = (element: HTMLElement, conf: ?Options): Promise<*> => {
const config = conf || {};
const logger = new Logger();
if (__DEV__ && typeof config.onrendered === 'function') {
logger.error(
`onrendered option is deprecated, html2canvas returns a Promise with the canvas as the value`
);
}
const ownerDocument = element.ownerDocument;
if (!ownerDocument) {
return Promise.reject(`Provided element is not within a Document`);