(ctx context.Context, props map[string]any)
| 42 | } |
| 43 | |
| 44 | func Button(ctx context.Context, props map[string]any) any { |
| 45 | ref := UseVDomRef(ctx) |
| 46 | clName, setClName := UseState(ctx, "button") |
| 47 | UseEffect(ctx, func() func() { |
| 48 | fmt.Printf("Button useEffect\n") |
| 49 | setClName("button mounted") |
| 50 | return nil |
| 51 | }, nil) |
| 52 | compId := UseId(ctx) |
| 53 | testContext := getTestContext(ctx) |
| 54 | if testContext != nil { |
| 55 | testContext.ButtonId = compId |
| 56 | } |
| 57 | return Bind(` |
| 58 | <div className="#param:clName" ref="#param:ref" onClick="#param:onClick"> |
| 59 | <bindparam key="children"/> |
| 60 | </div> |
| 61 | `, map[string]any{"clName": clName, "ref": ref, "onClick": props["onClick"], "children": props["children"]}) |
| 62 | } |
| 63 | |
| 64 | func printVDom(root *RootElem) { |
| 65 | vd := root.MakeVDom() |
nothing calls this directly
no test coverage detected