I'm the most senior developer on my current team, and I often get asked for help by my teammates. Sometimes when they ask for help, it's with something that I think is fairly obvious or easy to do. When I help them, I get some sort of compliment, but I don't know how to properly respond to it.
Here's a recent example of a conversation I had over slack with one of my teammates.
Teammate: I need to make this api call with the user id to get data for the modal, but the call is happening before the ID is set
Me: You could wait to make the api call until you open the modal instead of when the page is loaded. You could also use an observable so that your api call won't happen until the ID is set
Teammate: I never would have thought of that. You're so smart
The solution to the teammate's problem seemed really obvious to me because I've been writing code for several years. I realize that the solutions aren't obvious to others (or else they wouldn't need to ask me), but I don't feel that a compliment such as "You're so smart" is really necessary.
I want to acknowledge the compliment, but I don't want to accidentally insult the other person when I do so. For compliments like this I usually thank the person. Then I always feel the need to offer an alternative reason for my knowledge. In this particular case I said that I just have a lot of experience. I fear that my response could be seen as dismissive and/or rude.
How can I tactfully acknowledge these kinds of compliments without being rude to the other person?