Closed rubtsovi closed 3 months ago
My bad :/ I used props destructuring, so it did not work for dynamic props. If I pass prop to the styleX like that stylex.attrs(variants[props.variant])
it works perfectly. Closing issue.
I guess Vue props are similar to Solid where de-structuring can't be used.
Describe the issue
When using the styleX in Vue projects, it appears that dynamic changes to props do not trigger updates in the generated styles.
Expected behavior
Dynamic changes to prop value should trigger the application of appropriate styles.
Steps to reproduce
npm create vue@latest
@stylexjs/stylex
vite-plugin-stylex
and add this plugin tovite.config.js
:styleX.attrs(variants[variant])
Test case
Here I prepared the case: codesandbox
Additional comments
I tested the same with Vite + React - and it works perfectly, so assumed that the problem is not in
vite-plugin-stylex