in theory, Slots promise to solve the age-old problem having 10 hidden layers in your list component.
- I make a ❖list component wiht a slot that only accepts ❖list-item as children. Let’s say i am using this for a context menu.
- I now configure context menu with the options it should have.
- I make the context menu into a component, to lock in the content. The contents of the menu should be the same in every user flow where it is shown.
- While making my user flows, I set one of the ❖list-items to the hover state, to show the interaction.
- This causes the entire Slot to be marked as “modified”, and it will now stop receiving any updates from the ❖context-menu. If I decide to add a delete button to my menu, it will not show up in that instance.Â
- This runs contrary to the expected behavior when using components. If I had used Instance Swap instead of Slot, the state-change override would have been recognised, and any other changes would have continued to propagate. Instead, the Slot effectively detaches its children, rendering the entire system useless.
I think I saw somewhere that this is intended behavior, but I seriously can’t imagine that’s true.Â
