The US leader warned China against invading the island, likening such a move to Russia’s war in Ukraine.