Skip to content
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

Usage With Nextjs 13+ #3

Open
ChetSocio opened this issue Jun 8, 2024 · 0 comments
Open

Usage With Nextjs 13+ #3

ChetSocio opened this issue Jun 8, 2024 · 0 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@ChetSocio
Copy link
Owner

ChetSocio commented Jun 8, 2024

Hello devs. I have tested my package with Next.js 13, 14, 15 and its working fine on production mode but it needs some tweaks. Until I update docs, here's how you can use easy-magnify package's components with ease:

src/components/MyZoomComponent.tsx :

"use client";
import { EasyZoomOnHover } from 'easy-magnify;'

const MyZoomComponent = () => {

    return (
         <div>
               <EasyZoomOnHover
                    delayTimer={2000}
                     mainImage={{
                        src: "https://m.media-amazon.com/images/I/71sgEIlSvfL._AC_SX466_.jpg",
                        alt: "My Product",
                      }}
                     zoomImage={{
                       src: "https://m.media-amazon.com/images/I/71sgEIlSvfL._AC_SX1500_.jpg",
                        alt: "My Product Zoom"
                    }}
                 />
           </div>
     )
}

src/app/page.tsx:

import React from 'react';
import dynamic from 'next/dynamic'


const EasyZoomOnHover = dynamic(() => import('@/components/MyZoomComponent'), {
  ssr: false
})

const HomePage = () => {

  return (
    <div className="m-12">
      <EasyZoomOnHover />
    </div>
  )
}

export default HomePage

@ChetSocio ChetSocio changed the title Usage With Nextjs 14+ Usage With Nextjs 13+ Jun 8, 2024
@ChetSocio ChetSocio pinned this issue Jun 8, 2024
@ChetSocio ChetSocio self-assigned this Jun 8, 2024
@ChetSocio ChetSocio added the documentation Improvements or additions to documentation label Jun 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant