stephenscaff / react-animated-cursor

An animated custom cursor React component.
ISC License
273 stars 28 forks source link

Shows Blank Screen after Using Globally #24

Closed creative-muhd closed 3 months ago

creative-muhd commented 1 year ago

It keeps showing a blank page when put in App.js

stephenscaff commented 1 year ago

@creative-muhd can you provide more details on this issue? What your build and environment looks like, etc. A reduced test case would be ideal.

In most builds, like the demo, you'd include like

import React from 'react'
import AnimatedCursor from 'react-animated-cursor'

export default function App() {
  return (
    <div className="App">
     <AnimatedCursor
        dotSize={8}
        outlineSize={8}
        innerSize={8}
        outerSize={8}
        color='220, 90, 90'
        outlineAlpha = {0.4}
        outerAlpha = {0.4}
      />
      // Your other components
    </div>
  )
}

In a Next app, inside app.tsx, you'd include it like

const AnimatedCursor = dynamic(() => import('react-animated-cursor'), {
  ssr: false
})

function App({ Component, pageProps }: AppProps) {

  return (
     <AnimatedCursor
        dotSize={8}
        outlineSize={8}
        innerSize={8}
        outerSize={8}
        color='220, 90, 90'
        outlineAlpha = {0.4}
        outerAlpha = {0.4}
      />
    // Your other stuff
  )
}
creative-muhd commented 1 year ago

@stephenscaff Thank you I have discovers the issue, I had more than one react on the same app.

stephenscaff commented 3 months ago

Okay... closing this for now then. Thanks.