Example. Components with overrides
To summarize the current section, let's create a MyButton
component consisting of a link, an icon, and text. Let's add one src
parameter to the Props panel and add overrides to the nested components:
In this example, we created an overrides
object where we specified the list of all the overrides in the component. Then, inside the component, we called useOverrides
. We transferred the rest
object to the end of the parent component and called the override
function in each child component with the correct override name. When exporting the component, don't forget to transfer the previously created overrides
object.