How would I react?
I'd chuckle, tell them they're entitled to their opinion and if a friend continue on, else, find somewhere else I had to be.
Here is truth, but it is just truth, without action, it is dormant.
An insult can only hurt you if you empower the one that insults you. If it comes from a stranger it is nothing more than words. Friends and acquaintances can be far more complex and there are probably underlying issues between the dynamic to cause such behavior.
But you have to be able to judge yourself. Do you apply yourself, do you study, do you try to learn new things, do you exercise your mind?
If you are satisfied with the way you take in and impart knowledge and experience then whatever someone says about you is irrelevant.
The shock of a harsh opinion stings a little bit, but it can only do deep damage if it stirs up something within you that you are trying to avoid.
In that situation, listen to your internal voice. Learn to listen closely, very closely. It may be asking for a lot from you, in which case, let it know that it has been heard and you will try to incorporate the suggestion into your life.
Many do not like having frank, on the level conversations with their inner voice. Life is however, more peaceful, if you can learn to talk to it "on the level".