-
-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ENHANCEMENT]: Set content function lazily to the handlePrint function returned by the useReactToPrint() hook #652
Comments
Hello. Apologies for the very delayed response on this. Could you better explain what you are trying to do that you can't do today? |
Hello @MatthewHerbst , Here is what i am trying to do: After making this call to the hook: const printer = useReactToPrint(); I need to be able to optionally pass the /* @HINT: I need `content` to optionally be passed to the `handlePrint` function */
printer({ content: () => componentToPrintRef }); |
Ah, I see. Adding this should be doable. I probably can't get around to it until the weekend at the earliest, probably more likely over the Christmas break. Always happy to review/accept PRs too 😄 |
Thanks a lot @MatthewHerbst . I will be creating a PR in two days time for this. |
Hey @MatthewHerbst , as discussed earlier, the PR for this issue is ready for your review |
Hello @MatthewHerbst , i have updated the PR based on your review. It is ready for another review or approval. Thanks 🙏🏾 |
Hello @MatthewHerbst , i have updated the PR based on your last review. Thanks 🙏🏾 |
Hello @MatthewHerbst , just a small reminder. |
Nice! Merged it in, will get a release out with it either tonight or tomorrow. Thank you for all of your work on this! |
This is a feature enhancement request and i hope you would consider its' merits fairly.
I would like to have the content function set after the
useReactToPrint()
hook is initialised can called like so:I could ready a PR soon if you accept this enhancement request and you don't mind (since it's a small change)
The text was updated successfully, but these errors were encountered: