GX6001: island has no props struct
A TypeScript island has no props struct in its Go package.
Cause
A .ts file with a default export in a Go package is an island. The file name is the component name. The props of the island are the Go struct <Name>Props in the same package, and the package does not declare that struct.
Example
package dashboard
type Point struct {
Month string `json:"month"`
Total int `json:"total"`
}export default (el: HTMLElement) => {
el.textContent = "Revenue";
};gx check reports:
dashboard/RevenueChart.ts:1:1: GX6001: island "RevenueChart" has no props struct "RevenueChartProps" in its Go packageFix
- Declare
type RevenueChartProps structin a Go file of the same directory. - Give each field a
jsontag. An island with no props has an empty struct. - For a TypeScript file that is not a component, use a name that starts with a lower-case letter.