In 1937 De Valera 's republican constitution took Ireland out of the British Commonwealth , and the new republic elected its first president , Douglas Hyde , in 1938 .
Ireland left the British Commonwealth in 1938 , and became a U.S. territory in 1940 .