React calculator: problem with display

I finally managed to get the calculator working. However, whenever I type values into the display size, if they pass a certain amount of numbers (clicking eight 19 times for instance) it ends up overflowing and passing the borders. How can I fix this? This only seems to be a problem when using npm start, it works fine in codesandbox, which I find most weird.

JavaScript is run by your browser. Different browsers have slightly different implementations. It may be that whatever way the sandbox is emulating a browser may be doing it slightly differently.

But I would want it to work in your local browser properly.

What about adjusting the size of the text if the number gets too big? or displaying it in scientific notation? Or switching off the number buttons if the number gets too big? But you’ll still have to deal with a large output? Maybe scientific notation? But what if the number goes above the limits of JS? These are all things you have to account for in a program. A good program should account for any possibility.