Skip to content

Commit

Permalink
Rename other slot component's component
Browse files Browse the repository at this point in the history
  • Loading branch information
stevepiercy committed Feb 28, 2024
1 parent 40c1dfd commit 275b2c5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/source/configuration/slots.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Finally, let's register another slot component in the same slot, with the same n
config.registerSlotComponent({
slot: 'aboveContent',
name: 'header',
component: '@sneridagh what goes here as a different component?',
component: 'DefaultHeader',
});
```

Expand All @@ -110,7 +110,7 @@ Slot (`name`=`aboveContent`)
└── SlotComponent
├── `slot`=`aboveContent`
├── `name`=`header`
└── `component`=`@sneridagh what goes here as a different component?`
└── `component`=`DefaultHeader`
```

When the slot components with the same name and component under a given slot have all of their predicates return `true`, then that component will render in the slot.
Expand All @@ -119,7 +119,7 @@ Else, if there are slot components with the same name, but with a different comp
Thus the example slot renderer will have the following behavior.

- When both a user visits the route beginning with `/de/about`, and the content type is either a Document or News Item, then the component `PageHeader` will render in the `aboveContent` slot.
- When one or both of the predicates are false, then the component `@sneridagh what goes here as a different component?` will render in the `aboveContent` slot.
- When one or both of the predicates are false, then the component `DefaultHeader` will render in the `aboveContent` slot.

```{tip}
In our example, if we had not registered the third slot component—the one without predicates—and when either of the first two slot components' predicates return `false`, then no component would render.
Expand Down

0 comments on commit 275b2c5

Please sign in to comment.