Closed kazukinagata closed 2 years ago
Hi @kazukinagata,
First of all, thanks for creating a great library!
Thank you for showing your apreciation!
Sorry, I dont have time to actually deal with this issue right now but reading through it I noticed:
- return <img src={src} className={cx(className, classes.img)} />;
+ return <img src={src} className={cx(classes.img, classeName)} />;
The className
passed as prop should always have a higher priority from the internal state to allow the user of the component to overwrite whatever he see fit.
Thus, props.className
shoud always be the last cx
argument.
@garronej You were right! I'm a newbie to emotion, so it was very helpful to learn from you.
First of all, thanks for creating a great library!
I'm migrating a project from using jss towards tss-react but I'm struggling with the different style order when using
cx
.Codesandbox is here.
I have two components (Parent and Child), and I want to override the
objectFit
property ofimg
tag from Parent.The style generated by cx is as follows.
Using
styled
instead ofmakeStyles
get the expected result.