2

Trying to address a console warning I'm getting from MUI5/emotion (I think)

The pseudo class ":first-child" is potentially unsafe when doing server-side rendering. Try changing it to ":first-of-type".

So I was curious, what happens if you omit the selector in :first-of-type? I don't see any difference when I do this. Maybe it's ok?

EDIT: ^ This is my question and it is not answered in the question that is being linked too. I only included the emotion bit for context.

bonum_cete
  • 4,730
  • 6
  • 32
  • 56
  • 1
    Look at [this answer](https://stackoverflow.com/a/66124825/17182878) to a similar question, maybe it will help you understand the problem. – Oleg Barabanov Feb 01 '22 at 18:36

1 Answers1

1

Maybe it has something to do with browser compatibility. The pseudo class :first-of-type https://developer.mozilla.org/de/docs/Web/CSS/:first-of-type is understood by all browsers. Whereas :first-child is not supported by some. https://developer.mozilla.org/de/docs/Web/CSS/:first-child

Maik Lowrey
  • 15,957
  • 6
  • 40
  • 79