How to get a component to work in preview?

I am creating a simple component that affects the layout of child objects (2D). The simple component implements OnRectTransformDimensionsChange and the component works fine when I am running my program, but I also want it to work in the scene preview similar to how the rectTransform and other common components work in preview. Currently, it has zero effect - I’ll resize the parent object in the IDE or check and uncheck the component and nothing happens. What more do I need to do?

hi, take a look at this flag : ExecuteInEditMode