I have a button in my React project that I've set up this way.
<label style={styles.label}>
<input style={styles.input} type="file" accept="image/*" onChange={this.onUpload} />
</label>
The styles are set up like this
label : {
borderRadius: '1vh',
cursor: 'pointer',
height: '2.5vh',
margin: '0.5vh',
minWidth: '50px',
fontSize: '1.7vh',
justifyContent: 'center',
alignItems: 'center',
display: 'flex',
flexDirection: 'row',
backgroundColor : 'green',
color : 'black',
opacity : '0.9',
'&:hover': {
backgroundColor : 'green',
color : 'black',
opacity : '1',
},
},
input : {
zIndex : -1,
position : 'absolute',
opacity : 0,
visibility : 'hidden',
}
The hover style is not activated while the mouse hovers over the label and I'm not sure what I'm doing wrong here.