Skip to content
Gx
GitHub

GX2006: duplicate slot

A component call fills one slot two times.

Cause

A component call fills one slot two times.

Example

ui/card/Card.gx
package card

props {
  Header   gx.Node = nil
  Children gx.Node
}

<article>
  <header>{p.Header}</header>
  {p.Children}
</article>
ui/card/Page.gx
package card

<Card>
  <:header>First</:header>
  <:header>Second</:header>
  Text
</Card>

gx check reports:

gx check
ui/card/Page.gx:5:3: GX2006: slot "header" is given twice on <Card>

Fix

  1. Remove one of the two slot tags.
  2. Or put the two parts in one slot tag.