Also, is there something about MUI and react18 that makes styled-components more of a pain? Not sure where I heard that.
Also, is there something about MUI and react18 that makes styled-components more of a pain? Not sure where I heard that.
The writing on the wall is more that we wouldn't encourage this mechanism over time because we find that <link> + inline styles have much better performance tradeoffs. Often, it's possible to implement a very similar API but statically extractable. That's great and we encourage that. But we wouldn't add a runtime helper like css() into React because we don't think this pattern scales well. Of course, we can't stop people from using it though.
There are a few toolkits out there that let you write component-oriented CSS-in-JS, but during build will extract everything to static external style sheets.
It's worse than you know, Enzyme will never support React 18, and it will likely never officially (or fully) support React 17. It's a completely dead project.
https://dev.to/wojtekmaj/enzyme-is-dead-now-what-ekl
(Honestly I’m a bit surprised some big company hasn’t taken over Enzyme development - there most be teams facing hundreds ,or thousands, of hours on test rewriting)
However, we've worked closely with the React Testing Library maintainers, and that's the solution I'd recommend for React tests going forward. We're fans of RTL because it encourages you to write tests "end-2-end"-like tests that resemble real-world scenarios and are resilient to implementation changes.