Can the US and China Avoid the Thucydides Trap?

The “Thucydides trap” refers to the theory that when a rising power threatens a ruling power, the result is often war. Are the US and China headed there?