Taking a hard line on China is easier to do as a candidate than as president since world leaders need to work with trading partners.