Travel during F1 opt- H1B conversion

My employer will be filing for my H1B this April. I am currently on my F1 - OPT that expires in June (Jun 23). I need to travel outside the US in May. What are the consequences on my H1B application? Also, can I come back and apply for STEM extension or is it advisable to apply for STEM before I leave?

It is not advisable to travel when you are on F1 and applying for H1. Your immigration lawyer will also file your change of status (CoS) application along with your H1, which allows you to convert from F1 to H1 on Oct 1st once your H1 is approved.

In case when the person travels out of country as the application is processed, USCIS would consider that you abandoned your CoS application. This may not affect your original H1 petition, but affects only your CoS application. Incase you really have to travel, once the H1 petition gets approved, you will have to go out of the country and get H1 visa stamped with approval notice, in order to move to H1 status.