StateKey creates or retrieves reactive state with an explicit string key. Use this only for dynamic/conditional state where call-site identity isn't stable (rare).
(s *Scope, key string, initial T)
| 181 | // StateKey creates or retrieves reactive state with an explicit string key. |
| 182 | // Use this only for dynamic/conditional state where call-site identity isn't stable (rare). |
| 183 | func StateKey[T any](s *Scope, key string, initial T) *StateValue[T] { |
| 184 | return getOrCreateState(s, "key:"+key, initial) |
| 185 | } |
| 186 | |
| 187 | // RefValue holds a mutable value that does NOT trigger re-renders. |
| 188 | // Use for values that persist across renders but don't affect the view (timers, counters, refs to DOM elements). |
no test coverage detected