Hello, I believe the type of toPDF should not be void, but rather a promise. This way, we can utilize the Promise to access subsequent states and related functions, enabling us to perform more operations.
type UsePDFResult = {
/**
* React ref of the target element
*/
targetRef: MutableRefObject<any>;
/**
* Generates the pdf
*/
toPDF: (options?: Options) => void;
};
change
type UsePDFResult = {
/**
* React ref of the target element
*/
targetRef: MutableRefObject<any>;
/**
* Generates the pdf
*/
toPDF: (options?: Options) => Promise<InstanceType<typeof jsPDF>>;
};
Hello, I believe the type of
toPDF
should not bevoid
, but rather a promise. This way, we can utilize the Promise to access subsequent states and related functions, enabling us to perform more operations.change