I have a canvas within my Component
When the cursor enters the Canvas, I want it to change to the crosshair
style.
import styles from '../css/basic-styles.module.css';
const ImagePreview = () =>{
[mode,setMode] = useState(0);
changeMode(mode){
setMode(mode);
}
return (){
<canvas className={styles.canvas} width=200 height=200></canvas>
}
}
As for the CSS:
canvas:hover{
/*cursor:pointer;*/
cursor:crosshair;
}
Now, I need to dynamically change the CSS based on the value of mode
.
If mode is 1, I want to use the pointer
cursor style.
Should I just modify the css
? or is there another method to achieve this?