A friend once grumbled that, given the choice, she’d rather see her ex miserable than herself happy.

Few things in life are as traumatic as the end of a long-term, romantic relationship. Nonetheless, many people are able to eventually recover and move on relatively unscathed.

Others, like my friend, aren’t so lucky. Even years later, they remain mired in the pain of the experience. Any reminder of their former partner – whether it’s a casual mention in conversation or a Facebook photo – can elicit profound feelings of sadness, anger and resentment.

Why is it that some people continue to be haunted by the ghosts of their romantic pasts, struggling to let go of the pain of rejection?

In new research, my colleague Carol Dweck and I found that rejection actually makes some people redefine themselves – and their future romantic prospects.

In one study, we asked people to write about any lessons they’d taken away from a past romantic rejection. Analyzing their responses, we realized that a number of respondents thought the rejection unmasked a basic negative truth about themselves – one that would also sabotage their future relationships. Some said they’d realized that they were too “clingy.” Other thought they’d been “too sensitive” or “bad at communicating.”

Additional studies explored the consequences of believing that rejection had revealed a fundamental flaw. By linking rejection to some aspect of their core identity, people found it more difficult to move on from the experience. Some said they “put up walls” and became warier about new relationships. Others were afraid to disclose the rejection to a new partner, fearing that this person would change their opinion of them, thinking they had “baggage.” (This might explain why some people hide past rejections, treating them like a scar or stigma.)

We then wondered: what makes someone more likely to link a romantic rejection to some aspect of “who they really are”? After all, other respondents wrote that rejection was merely a part of life, that it was an important part of growing up and actually caused them to become better people.

It turns out that your beliefs about personality can play a big role in how you’ll respond to romantic rejection.

Past research has found that people hold divergent views about their personal characteristics, whether it’s their intelligence or shyness. Some people have a “fixed mindset,” believing that these qualities are unchangeable. In contrast, those who have a “growth mindset” believe that their personality is something that can evolve and develop throughout their lives.

These basic beliefs shape how people respond to failure. For example, when people believe that intelligence is fixed, they’ll feel worse about themselves – and are less likely to persist – after experiencing a setback.

We thought that beliefs about personality might determine whether people see rejection as a piece of evidence about who they really are – as a sign of whether they are a flawed and undesirable person.

In one study, we divided people into two groups: those who think personality is fixed, and those who think personality is malleable. Participants then read one of two stories. In one, we asked them to imagine being left, out of the blue, by a long-term partner. In the other, we asked them to imagine meeting someone at a party, feeling a spark and then later overhearing that person telling a friend that they would never be romantically interested in her or him.

We might expect that only a severe rejection from a serious relationship would have the power to make people question who they are. Instead, a pattern emerged. For people with a fixed view of personality, we found that even a rejection from a relative stranger could prompt them to wonder what this rejection unveiled about their core self. These people might worry that there was something so obviously undesirable about them that a person would reject them outright – without even getting to know them.

So what can we do to prevent people from linking rejection to the self in this negative way? One promising piece of evidence shows that changing someone’s beliefs about personality can shift his or her reaction to rejections.

In a final study, we created articles that described personality as something that can evolve throughout the course of a lifetime, rather than as something that’s predetermined. When we asked people with a fixed view of personality to read these articles, they became less likely to interpret rejections as an indication of a permanent, fatal deficiency.

By encouraging the belief that personality can change and develop over time, we may be able to help people exorcise the ghosts of their romantic pasts – and move on to satisfying relationships in the future.