Kursor icon indicating copy to clipboard operation
Kursor copied to clipboard

Does not work with React

Open kostberg opened this issue 5 years ago • 8 comments

Tried to implement this cursor in my react app but it wasn't compatible. Could this be fixed?

kostberg avatar Sep 12 '20 14:09 kostberg

+1 I can't make it work with Gatsby.

Frostbourn avatar Sep 14 '20 09:09 Frostbourn

Think this means we will have to fix this ourself :/

kostberg avatar Sep 16 '20 18:09 kostberg

Think this means we will have to fix this ourself :/

Just put the css files from cdn and everything should work.

Frostbourn avatar Sep 17 '20 06:09 Frostbourn

Any examples on how to get it working on React/Next.js

kkkarannn avatar Oct 17 '20 21:10 kkkarannn

To make kursor work with Gatsby just put the code below to gatsb-browser.js

import kursor from "kursor"

new kursor({
  type: 2,
  color: "#B98FFF",
  removeDefaultCursor: true,
})

Frostbourn avatar Nov 04 '20 10:11 Frostbourn

Hi guys, I also had the same problem while using this dependency with Next.js.

Read this from the documentation to get a better understanding: https://bit.ly/3rMUWQL

"_document.jsx" code:

import Document, { Html, Head, Main, NextScript } from 'next/document'

class MyDocument extends Document {
  static async getInitialProps(ctx) {
    const initialProps = await Document.getInitialProps(ctx)
    return { ...initialProps }
  }
  render() {
    return (
      <Html lang="en">
        <Head>
            <link rel="stylesheet" href="https://unpkg.com/kursor/dist/kursor.css" />
        </Head>
        <body>
          <Main />
          <NextScript />
        </body>
        <script src="https://unpkg.com/kursor" />
        <script dangerouslySetInnerHTML={{__html:`new kursor({ type: 1, removeDefaultCursor: true })`}} />
      </Html>
    )
  }
}

export default MyDocument

Hope this helps 😉

FranciscoMendes10866 avatar Feb 12 '21 15:02 FranciscoMendes10866

It's so easy to use like cutting a cake.

#import import Kursor from "kursor"; import 'kursor/dist/kursor.css'

you can change the type as you want.

new Kursor({ type: 2 })

ksnirob avatar Dec 24 '21 17:12 ksnirob

my cursor only show on the hero section only not to all body by default it should be on body but not work

Huzaifa-Ansari222 avatar Nov 19 '23 14:11 Huzaifa-Ansari222