Closed oxc closed 4 years ago
I've extracted another function that takes an RClass<P>
and returns a RClass<P>
. The withStyles type definition calls this TypeInjector.
I had to use klazz.rClass instead of klazz.js, requiring the type parameter to be RComponent
instead of Component
. In theory this is a breaking change, but should not have any effects in practice. Given the 0.x.x status of the library, I find this change acceptable.
Please let me know if this is ok, or if you want to go back to the previous version.
Please let me know if this is ok, or if you want to go back to the previous version.
@oxc This is OK, no problem at all. Thanks for the awesome Pull Request!
Creating a new RClass in each invocation can prevent reconciliation of such components. Extract a separate method that returns the styled class, so it can be stored for recurring usage.