People don't make fun of Americans just for stating or being interested in their heritage — it's specific behaviour and language use in specific circumstances that elicits what usually amounts to an eye-roll at most.
(Apologies — I can't easily write perfectly idiomatic US English, so the following might sound a little off, but they're examples of the kinds of things people might say.)
Two Americans chatting together about their heritage:
US 1: "I'm mostly Danish with some German, you?"
US 2: "I'm Irish, and my husband's part Irish too."
Totally fine. Everyone in the conversation gets the context, which is that between two Americans, the American part goes without saying, and an outsider overhearing would get the context too.
A Brit talking to an American:
UK: "So what do Americans do at Christmas?"
US: "I'm actually Italian-American, so it's a little different — we have a lot of traditions going back to before my family came over here."
Also totally fine. Nobody's got any problem with that. The heritage is relevant and interesting and nobody sounds like they're claiming to be anything they're not.
US: "I'm trying to find out more about my Scottish roots — I've found out I'm also English, Irish, West African, French, but my great grandmother was from Aberdeen and right now I want to learn more about what that was like for her."
Still fine, the context shows that when they're saying "I'm French" it's in a family history and heritage context, and even though the Scottish connection is only one part of this person's background, there's nothing wrong with taking an interest in one particular part of the story.
US: Where are you from?
Irish: "I'm Irish, from Cork."
US: " You're Irish? I'm Irish! I love St Paddy's Day, d'you wanna see my shamrock hat? Chucky arla, amirite? Do you know my folk, the Sliggo Connors? What about those nuns, huh? Kiss me, I'm Irish, to be sure! So great to meet another Irish person here." [/mild exaggeration]
🙄