If I move out of range after a spell is cast, but before a spell hits me, does it miss?

Does a reaction that causes me to move out of range after the spell is cast but before the spell hits cause it to miss?

A couple ways this can be done are

  • Readied action to move with a trigger: target casts the spell
  • Mage Slayer feat with a melee weapon attack that moves the caster