A
A
Alexander2021-03-26 10:10:56
React
Alexander, 2021-03-26 10:10:56

How to access another element on hover in material ui?

I want to rewrite the code from css to material ui makeStyles()
I tried this method but it doesn't work, how can I refer to another element on hover?
I will be grateful for the answer

.avatar:hover .changePhoto {
  display: block;
}


avatar: {
      '&:hover': {
        changePhoto: {
          display: 'block',
        },
      },
    },

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2021-03-26
@axrising

avatar: {
  '&:hover': {
    '& $changePhoto': {
      display: 'block',
    },
  },
},
changePhoto: {},

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question