mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
Add deprecation warning for onrendered (Fix #1290)
This commit is contained in:
parent
a6a206c721
commit
8e32c139dd
@ -39,6 +39,12 @@ const html2canvas = (element: HTMLElement, conf: ?Options): Promise<*> => {
|
|||||||
const config = conf || {};
|
const config = conf || {};
|
||||||
const logger = new Logger();
|
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;
|
const ownerDocument = element.ownerDocument;
|
||||||
if (!ownerDocument) {
|
if (!ownerDocument) {
|
||||||
return Promise.reject(`Provided element is not within a Document`);
|
return Promise.reject(`Provided element is not within a Document`);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user