Stop infinite recursion when updating state - SolidJS