WA Premier Mark McGowan has used social media to blast Andrew Hastie after the federal Liberal MP warned Beijing's aggressive expansion into the region posed a threat to Australia's economy and national security.

Mr Hastie triggered a major political debate after he said Australia must wake up to the reality of China's ambitions, and likened the world's understanding of the emerging superpower to Allied miscalculations in the defence of Western Europe during World War Two.

Premier Mark McGowan (right) has hit out at comments by Canning MP Andrew Hastie, who is warning on the growing threat of Beijing to Australia. Credit:Alex Ellinghausen

Mr McGowan said China was a good friend to Western Australia and "our largest trading partner", noting "25 per cent of the WA economy is based on our trade with China."

"I urge members of the Liberal Party to stop damaging the relationship and threatening WA jobs with extreme and inflammatory language," he said.