What is happening in React will remain in past?
Unfortunately, for some reason, I am going to start looking for new opportunities as a Frontend Developer.
Yeah, I know that feeling, long interviews, assignments, and pair programming, this story is about an interview question that messed up the entire interview and the question was.
Why does React throw a warning if we pass the index as a key to the array elements?
Yeah I know I should have known and this is a very basic question, which is entirely correct and yes I did answer the question during an interview but I did take my time.
Okay, so what went wrong?
After working with React for more than a year, this should be a piece of cake, but after working for the entire year, things will start becoming a habit and after a time I forgot to question every line of correct code we write, why? because I read it somewhere initially.
So, coming back to the interview, my initial answer was duplication, but this was not the main reason behind the warning, which I soon realized after looking at the array behavior for the case if we remove some element from the array and that I answered but till then it was late.
What went wrong?
Yep, take your time and then answer, in this case, it felt like I was doing the competitive programming (which I am not good at) and they were checking my problem-solving skills but this was not the case.