React cursor none does not have the ability to adjust

I am currently working with React and Next.js.
I am trying to hide the pointer using cursor: none.
Even though I used cursor: none, the pointer is still visible.

const Home: FunctionComponent = () => {
  const [mouseX, setMouseX] = useState(0);
  const [mouseY, setMouseY] = useState(0);
  const Mouse = (e: any) => {
    setMouseX(e.clientX);
    setMouseY(e.clientY);
  };

  return (
    <>
      <div
        style={{
          position: 'absolute',
          top: mouseY,
          left: mouseX,
          height: '20px',
          width: '20px',
          background: 'linear-gradient(to right, #aed0ee 0%, #00f2fe 100%)',
          cursor: 'none',
        }}
      ></div>
      <div
        style={{ width: '1000px', height: '1000px' }}
        onMouseMove={(e) => Mouse(e)}
      ></div>
    </>
  );
};

export default Home;

Answer №1

Specify the following in your desired element:

style={{
  "&:hover": {
    cursor: "none"
  }
}}

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Tips for Customizing Dialogs with CSS Classes in mui5 Using Emotion/Styled

When attempting to customize the styling of a mui Dialog, I encountered an issue where it wouldn't accept className even when placed inside PaperProps. While inline styles worked, my preference was to import styles from a separate stylesheet named Sty ...

CSS3 blending modes

I am attempting to create a design similar to this letter on an image using blending modes. Check out my code example <div id="box"> <div id="image"> <img src="https://www.epicurrence.com/images/speakers/julie.jpg" /> </div&g ...

How can I create a dashed border for a pie chart using highcharts?

Is there a way to change the default solid border of a pie highchart to dashed? This modification is only necessary for pies without data or with negative data values. Perhaps it's possible to redraw the SVG of the border, like in this example: https: ...

Display a progress bar in an application to visualize the loading of database records

Within my application, I am accepting a numerical input that is used to generate results on a separate page. The process involves running multiple sequential JDBC queries against Oracle database tables, resulting in a significant delay (1-2 minutes) for th ...

How to center content vertically in a Bootstrap 5 column div

I assumed that aligning content vertically in a div should be easier compared to using a table: Edit: I want to align the first and last columns while keeping the others as they are. <link href="https://cdn.jsdelivr.net/npm/&l ...

Using babel to enhance a React component with a decorator

I've recently set up a basic startup app using create-react-app. However, I'm trying to minimize the number of modules being imported and loaded into my project without knowing their purpose. To achieve this, I decided to start with a nearly empt ...

The circles seem to be elusive, refusing to make an appearance on the forefront of the HTML webpage

My scatterplot circles appear to be behind the graph, and I can't figure out how to bring them to the front. Can anyone help me with this issue? Even though the inspection shows that the circles are there, they are not visible on the plot. scatterplo ...

Tips for embedding Jquery code within Vuejs applications

Trying to code a Vue.js Navbar that changes color when scrolling using Jquery and CSS script. It works, but I encountered an error with Vue.js not supporting the syntax '$' after page refresh, resulting in a "$ not defined" error message. As a ne ...

openssl reported an Error Stack error with code 03000086, specifically stating that there was an issue with the initialization

opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ], library: 'digital envelope routines', reason: 'unsupported', code: 'ERR_OSSL_EVP_UNSUPPORTED' } Node.js v19.5.0 I e ...

NextImage encountering issues in Internet Explorer 11

In my TypeScript setup, here is a snippet from my package.json file: "dependencies": { "@tailwindcss/typography": "^0.4.1", "@webcomponents/shadydom": "^1.7.4", "cookie": "^0.4.1", " ...

CSS Trick: How to Clear Content in a 3-Column Div arrangement

I've been struggling to clear the content below my three div columns, each consisting of a span with centered text and a textarea. It seems that the issue arises from the floating div tags without proper clearing. When viewed in Firefox, the next ele ...

The spacebar is not functioning properly within a `button` element while using HTML5 `contenteditable`. What steps can I take to fix this issue and get it working correctly?

When using the HTML5 contenteditable attribute, I've noticed that the spacebar does not work in the button element, but it works perfectly fine in the div element. Does anyone have a solution to get it working properly? You can see the issue here: ht ...

Synchronization problem with Apollo Client cache between multiple instances in a Next.js application using React Apollo and managed with pm2

Currently, I am utilizing Next.js and React Apollo for my application. To ensure optimal performance, I have configured my application to run with pm2 in a clustered mode featuring two instances. However, I have encountered an issue where switching user pr ...

Clicking outside the navigation container will not cause it to disappear completely

When the width of my navigation bar reaches a maximum of 560px, a hamburger menu appears for mobile devices. I want to implement a functionality where clicking on a navigation item (e.g., About) will close the nav-container instead of making it disappear c ...

Preventing the occurrence of [ { "description": null } ] in PostgreSQL with a React application running on http://localhost:3000

While working on my localhost project at port 3000 in the Pern Todo List, I encountered a bug. When I type something and click "Add" using a POST request from my React app, the data should be added successfully. However, when I use Postman to make a GET re ...

Examining React components using Angular-cli

In my application, I have successfully compiled the reagent components along with the entire app. Now, I am trying to set up karma for testing the React components. Using Angular 6+ However, I am encountering an error with the React components: Uncaught ...

Use react-router-dom v6 to move through pages following user interaction

I recently began learning React just 15 days ago. The code below successfully adds the post, but it is not redirecting to "/". I am currently using react-router-dom version 6. render(){ return <div> <Routes> ...

Container for grid template columns and responsive window in a single row

Imagine having around 250 divs with the class slider-item styled in a certain way. You have a responsive grid in CSS called A which arranges these divs as columns/items when the window resizes, with a minimum item width of 240px. Check out how it looks bel ...

Managing Flicker Effect by Implementing Theme Switching and Using Local Storage in Next.js with Ant Design

I've been working on a new feature to switch themes (light/dark) dynamically in a Next.js application using Ant Design. Successfully integrating the theme switch with a toggle switch and useState hook, I'm faced with the challenge of storing the ...

Obtain an array of documents within collections using Firestore in React.js

I am encountering issues with the code below as I am trying to retrieve a single document based on the ID provided. import React, {useState, useEffect } from 'react'; import { useParams } from 'react-router-dom'; import {db} from &q ...