Resolved: How can I style it with @emotion/styled? Old makestyles from mui issue

In this post, we will see how to resolve How can I style it with @emotion/styled? Old makestyles from mui issue

Question:

I’m trying to set up my style via @emotion, since makestyles were removed in React 18. I changed the code in this way in line with my research, but I still can’t see any change in my page.
Normally it should look like this: enter image description here
But it looks like this: enter image description here
App.js file


Best Answer:

Two examples are presented below: One with styled, one without. It is not necessary to use styled. As you can see from the examples the code without styled is less verbose and (in my opinion) easier to understand.
In the examples the VideoPlayer, Options and Notification components were replaced with div and span for testing.

Example with styled


Example without styled


If you have better answer, please add a comment about this, thank you!

Source: Stackoverflow.com