You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we want to render pdf using a call to an API in the same component, we will always have the initialization state as undefined for the filename until we receive the actual file name for the API.
Though this can be handled gracefully in the JSX rendering, the hook itself will fail :
If we want to render pdf using a call to an API in the same component, we will always have the initialization state as undefined for the filename until we receive the actual file name for the API.
Though this can be handled gracefully in the JSX rendering, the hook itself will fail :
If we try to initialize the usePdf conditionally, the hook fails again:
How can we handle such case without having to load a dummy pdf but instead by hiding the component?
Current code:
The text was updated successfully, but these errors were encountered: