I am a junior FE dev and might not have that much experience in this field as other commenters.
Still, my senior told me a few days ago: "The only way to avoid being replaced by AI as a dev is to become a dev that knows how to work together with AI". And I think this is the only way to stay relevant as a dev in the future.