(ctx context.Context, val T)
| 397 | } |
| 398 | |
| 399 | func UseRef[T any](ctx context.Context, val T) *VDomSimpleRef[T] { |
| 400 | _, hookVal := getHookFromCtx(ctx) |
| 401 | if !hookVal.Init { |
| 402 | hookVal.Init = true |
| 403 | hookVal.Val = &VDomSimpleRef[T]{Current: val} |
| 404 | } |
| 405 | refVal, ok := hookVal.Val.(*VDomSimpleRef[T]) |
| 406 | if !ok { |
| 407 | panic("UseRef hook value is not a ref (possible out of order or conditional hooks)") |
| 408 | } |
| 409 | return refVal |
| 410 | } |
| 411 | |
| 412 | func UseId(ctx context.Context) string { |
| 413 | vc := getRenderContext(ctx) |
nothing calls this directly
no test coverage detected