Comments (5)
Hi,
I succeeded to add react-special-cursor in my Next.js with next-transpile-modules :
1/ installation
npm i next-transpile-modules
2/ Modify next.config.js
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
eslint: {
ignoreDuringBuilds: true,
},
}
const withTM = require("next-transpile-modules")([
"react-special-cursor",
]);
module.exports = withTM({
nextConfig
});
3/ add css in _app.js
import "../styles/globals.scss";
import "../styles/fonts.scss";
import "react-special-cursor/src/Cursor/Cursor.scss"
function MyApp({ Component, pageProps }) {
return <Component {...pageProps} />;
}
export default MyApp;
4/ import react-special-cursor in component
from react-special-cursor.
inside the Cursor.js, it is calling the Cursor.scss remove it and check other files also besides that I haven't tested it on server-side rendering libs like nextjs.
if it worked correctly with simple import that's good if not try to import it dynamically on the front I think next has its doc about it
from react-special-cursor.
Thank's for your help !
I will try asap.
from react-special-cursor.
Since it's not an issue, I will close it but fill free to reopen it or ask questions.
Also, were you able to fix the problem and use the cursor?
from react-special-cursor.
The problem now is from using css Module with sass in next.js, so I can't use hoverClasses with className={styles.error}.
https://nextjs.org/docs/basic-features/built-in-css-support
<Cursor
hoverClasses={[
{ classNameOfTargetElement: "head", classNameOfStyle: "head-hover" },
...
from react-special-cursor.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-special-cursor.