A war with China will only happen if China invades Taiwan.
China make's no secret of its desire to conquer what it regards as a rouge province of the mainland state. However I would be very surprised if they take the risk.
Should China succeed, its no guarantee that the US will come to liberate the Taiwanese. It would require a colossal commitment of lives and equipment and the US population does not have appetite for such conflict. Unless they can form a coalition task force with Australia, Japan and South Korea.