func (state State) GetState(stateType interface{}) interface{} {
	for _, p := range state {
		if reflect.TypeOf(p) == reflect.TypeOf(stateType) {
			return p
		}
	}
	return stateType
}
GetState lets you retrieve the state of your passed in type from a UseState
hook.

Because we cannot use generics this is the closest we can get. This is like
Properties where the stateType type is a key to the struct in the slice of
interfaces.
As such, you can only have one of a given type in state.
package r
import (
	"reflect"
	"sync"
)
type (
	Action        = func(s State) State
	ActionCreator struct {
		h *hook
		a Action
	}
	SetState = func(a Action)
)
func UseState(initial State) (State, SetState) {
	hookFiberLock.Lock()
	checkStateTypesAreUnique(initial)
	var oldHook *hook
	if hookFiber != nil &&
		hookFiber.alternate != nil &&
		hookFiber.alternate.hooks != nil &&
		len(hookFiber.alternate.hooks) > hookIndex &&
		hookFiber.alternate.hooks[hookIndex] != nil {
		oldHook = hookFiber.alternate.hooks[hookIndex]
	}
	var h *hook
	if oldHook != nil {
		h = oldHook
	} else {
		h = &hook{
			tag:   hookTagState,
			mutex: &sync.Mutex{},
			state: initial,
		}
	}
	var actions []Action
	if oldHook != nil {
		actions = oldHook.queue
		for _, action := range actions {
			h.state = action(h.state)
		}
	}
	if hookFiber != nil {
		hookFiber.hooks = append(hookFiber.hooks, h)
		hookIndex++
	}
	hookFiberLock.Unlock()
	return h.state, h.setState()
}
func (h *hook) setState() SetState {
	return func(a Action) {
		setStateChan <- ActionCreator{
			h: h,
			a: a,
		}
	}
}
func (ac ActionCreator) addToQueue() {
	ac.h.mutex.Lock()
	if ac.h.mutex == nil {
		panic("h is gone")
	}
	ac.h.queue = append(ac.h.queue, ac.a)
	ac.h.mutex.Unlock()
}
func checkStateTypesAreUnique(s State) bool {
	seenPropTypes := make(map[reflect.Type]bool)
	for _, p := range s {
		if seen := seenPropTypes[reflect.TypeOf(p)]; seen {
			return false
		}
		seenPropTypes[reflect.TypeOf(p)] = true
	}
	return true
}