No. ESTA travel authorization needs only to be valid upon arrival in the United States.
A travel authorizations are valid for two years from the date of authorization, or until your passport expires, whichever comes first.
If you obtain a new passport or change your name, gender or country of citizenship, you will be required to apply for a new travel authorization. This is also required if one of your answers to any of the VWP eligibility questions changes.
If your ESTA has expired, you must reapply by submitting a new application.
If your ESTA expires while in the U.S. it will not affect your departure.