React Calculator when adding while loop to logic resets state causing infinite loop?

here is the project: (loop in question starts at 108 but is commented out)

no css added yet, logic for calc works without a while loop triggering the function(= button) mutiple times untill output is assigned however if i add a while loop so it will calculate untill the output is found it gets stuck at the first statement and numOne seems to be assigned back to its default null causing an infinite loop?

im guessing something is causing a rerender but im not sure why or how is behavour works?

on a side note also test 8 doesnt pass: "As I input numbers, I should be able to see my input in the element with the id of “display” "
However the input deffently does update

Not too sure about the while loop logic, but for the display you are outputting it like so:

<div id="display">
    <p>
          "1"
          "+"
          "1"
          "+"
          "1"
    </p>
</div>

As opposed to
<div id="display">1+1+1+1</div>

thanks for lookin! :slight_smile: how is that fixed im not telling it to put each on a seprate line am i? ive tried without the p’s i just added them lookin for a reason why the test fails the debug text says:
Numbers do not display correctly within id=“display” : expected ‘0’ to equal ‘123’

which seems like its not even getting 1 digit update even tho it is reading the zero correctly