Skip to content

Is there any way to get the url of the document? #1155

Answered by diegomura
wenscl asked this question in Q&A
Discussion options

You must be logged in to vote

That' not how the BlobProvider is supposed to work. Defining just variables inside a React component and expecting the rendering to have the right value is unreliable. You can wither try saving the url in the component state, or consume BlobProvider like this:

<BlobProvider document={document}>
  <MenuItem onClick={() => window.open(url, "_blank")}>
    Exportar a PDF
  </MenuItem>
</BlobProvider>;

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by diegomura
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants