-
Hi! I would like to know if there is any way to get the url of the document to use it in the onclick event of the menu item of react mui.
|
Beta Was this translation helpful? Give feedback.
Answered by
diegomura
Mar 29, 2021
Replies: 1 comment
-
That' not how the <BlobProvider document={document}>
<MenuItem onClick={() => window.open(url, "_blank")}>
Exportar a PDF
</MenuItem>
</BlobProvider>; |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
diegomura
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 theurl
in the component state, or consumeBlobProvider
like this: