Your nails and hair continue to grow when you die
What is actually happening is that your skin is drying out and shrinking, thus giving the illusion that your nails and hair have become longer.