Skip to main content
Question

Changes to the nested object aren't applied when changing the variant of mother object


Ewa_Bak

Is there a way to keep changes applied to the nested when changing the variant of mother object?

For example I have this component which has nested pill component. If I make changes to child component, like changing the color of this pill this change won’t be applied when I will change variant of this child component.

This topic has been closed for comments

5 replies

Dennis_N
  • Power Member
  • 183 replies
  • January 18, 2024

This should work out of the box without any special tricks.
All you need to ensure is that namings match across variants.

See:
example.fig (62.8 KB)


Ewa_Bak
  • Author
  • 2 replies
  • January 18, 2024

Thanks! I found that what caused the problem was that I changed original color of nested component. Is there a way to have different color than mother component and still be able to change this color and keep it while changing variants?


Dennis_N
  • Power Member
  • 183 replies
  • January 18, 2024

Depending on what you are exactly aiming for you could do things like this:

example2.fig (33.0 KB)
(I used the base component method and exposed the nested properties)


Ewa_Bak
  • Author
  • 2 replies
  • January 18, 2024

Thanks! I seem to have still problem with it in my original components but its working on another ones.


Dennis_N
  • Power Member
  • 183 replies
  • January 18, 2024

Resetting everything often helps.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings