Why does this loop infinitely - SolidJS