K
K
Kipsy2020-02-12 22:00:57
JavaScript
Kipsy, 2020-02-12 22:00:57

How can you use pseudo-classes inline in react?

Please tell me when writing inline styles in react, is there any way to add :hover for example?

const styleCardMenu = {
    boxShadow: '0 4px 5px 0 rgba(0, 0, 0, .24)',
    border: '1px solid red'
    }

for example how to apply hover here?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Klein Maximus, 2020-02-13
@Kipsi

Depends on what you use for inline styling.
If it's just an ordinary object, then nothing.
If something like Radium , then here is an example .

A
Alexander Ataakgayev, 2020-02-12
@badJaguar

const style = {
  color: '#000000',
  ':hover': {
    color: '#ffffff'
  }
};

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question