Skip to content
Gx
GitHub

GX2001: missing required prop

A component call does not pass a prop that has no default.

Cause

A component call does not pass a prop that has no default. A prop with no default is required.

Example

ui/card/Card.gx
package card

props {
  Title string
}

<article>{p.Title}</article>
ui/card/Page.gx
package card

<Card />

gx check reports:

gx check
ui/card/Page.gx:3:1: GX2001: missing required prop "Title" on <Card>

Fix

  1. Pass the prop at the call.
  2. Or give the prop a default in the props block of the component.