-
Notifications
You must be signed in to change notification settings - Fork 34
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
Nextjs support #59
Comments
Hey there I'm getting the same error..did you found any solution.. Or any alternative to download dom as image? |
@kr-anurag @saipranay47 Yoou can use so const exportImageRef = useRef();
React.useEffect(() => {
if (typeof window !== undefined) {
import('react-component-export-image').then(
module => (exportImageRef.current = module)
)
}
}, []) and to call the methods const onDownload = () => {
return exportImageRef.current?.exportComponentAsJPEG(ref)
} Original Issue: #42 |
Hey there, For more information follow official docs. Here Sample Code from docs: import dynamic from 'next/dynamic'
const DynamicComponentWithNoSSR = dynamic(
() => import('../components/hello3'),
{ ssr: false }
)
function Home() {
return (
<div>
<Header />
<DynamicComponentWithNoSSR />
<p>HOME PAGE is here!</p>
</div>
)
}
export default Home Edit: |
I got this error when trying import it "react-component-export-image": "^1.0.6", |
This is work for me:
|
Thanks @detautama. Does this work for you on mobile devices? I'm trying to download on Chrome (on iPhone) and it doesn't download an image, just a file called 'download'. |
Thank you so much |
Giving this error while using Nextjs
The text was updated successfully, but these errors were encountered: