0
votes

I am making an Algorithm sorting visualizer, my problem is that I am not able to figure out how I will change the background colour of each Bar while iterating in for loop and while adding console logs or set statement of useState the for loop slows down, is there is any way to fix it

And yeah I tried to set the FirstIndexToCompare and SecondIndexToCompare in the loop but didn't work, while console logging it shows null

Git Repo: https://github.com/the-wrong-guy/Sorting-Algorithm-Visualizer

Hi and welcome to Stack Overflow, find some hints on how to ask questions here: stackoverflow.com/help/how-to-ask Also, please post your code directly here (you can format it with backticks).Clara
@Clara i tried codesandbox but due to some error i can't replicate the code from the Git repo so share i the Git repo, as you can see aboveShisui