Sarah Hyland has no idea what happens in 'Modern Family' until she watches the show.

The 29-year-old actress - who plays Haley Dunphy on the show - was stunned to tune in this week and learn about the death of her onscreen grandfather Frank (Fred Willard) because she only reads the scripts for her own scenes.

She admitted on her Instagram Story: ''So I don't read scripts of the episodes of 'Modern Family' that I'm not in, so I just found out that my grandpa's dead along with all of you. I still feel special.''

Fans then complained the actress had shared a major spoiler so she later returned to apologise but admitted she'd blurted out the reveal because she was so shocked.

She said: ''Oh yeah, I guess I should have put a spoiler alert for Grandpa Frank dying, but I was just caught off-guard.

''As his granddaughter, you'd think I'd be invited to the funeral.''

Sarah suffers from kidney dysplasia - a condition in which the kidneys don't fully develop in the womb - and previously admitted she thinks her chronic illness ''happened for a reason'' and it really makes her ''stronger'' as a person.

She said: ''Everything happens for a reason. [Struggles are] only going to make you a stronger and more efficient person ... When I found out, there was a nice cocktail of guilt, fear and a kind of hopelessness. But also it was like, okay, this is now a part of your life.''

The actress underwent a second transplant in 2017, this time with her brother donating his kidney, and thankfully the surgery was successful.

And now, Sarah says that whilst it is ''okay'' for other chronic illness sufferers to ''feel angry'', they shouldn't let it ''consume'' them.

She said: ''People who have chronic illness should take the time to say, 'This isn't fair.' Take a moment to cry and be like, 'F you', to whomever did this to me. It's okay to feel angry, just don't let it be all-consuming. I have realised the benefits of being able to talk about it. Not just for on a mental level for myself, but so that others don't feel so alone.''