OSTENSIBLY a one-party Communist state, China in some respects has the equivalent of two parties. Both believe in modernizing China and protecting it from outside harm, but they take sharply different approaches. One party, personified by Mao Tse-tung, who died in 1976, believes in a domestic policy based on exhortation, sacrifice and discipline and a foreign policy based on balancing off China's foes. The second, led by Deng Xiaoping, the current party vice chairman, follows a domestic policy leaning more to incentives and decentralization and a foreign policy leaning more to foreign friends, including Japan, Europe and the United States.

Mr. Deng's party has just won a striking victory. A protege has replaced Mr. Mao's chosen successor, Hua Guofeng, as party chairman, and Mr. Deng himself has taken the Mao man's second hat as head of the party military commission; the Mao line has been condemned. But it is not a complete victory. Hua Guofeng remains in a position to fight another day, as do the thousands of party aids and millions of party members loyal to him, to their own status and habits, and to the Mao heritage of permanent revolution.

In its ascent in the last few years, the Deng party has won broad favor in the West. For its greater openness to certain -- not all -- foreign ideas and ways, it has been praised as pragmatic and moderate. Recently, China bravely opened its books to the World Bank, from which it now seeks large (concessional) loans. It has also been seeking new ties with foreign private capital. For the first time the Communist regime has swallowed its pride and invited international relief to cope with drought and flood. Just the other day, it opened up a new pipeline to the Pentagon. Internally, it has been relaxing central controls and offering selected incentives to spur growth and boost productivity. The spectacle of a friendly socialist country, one making capitalist-type reforms and cooperating strategically, too, is a sight for sore Western eyes -- even Ronald Reagan's.

There is just one big hitch, and all the players know it. In a vast, poor, underdeveloped country like China, moderation and pragmatism have their limits. Extra consumption may rob funds from investment. Incentives may sharpen class and regional divisions. Loosening of controls may erode party control. Opening up to foeigners may attract fewer resources and more cultural germs than the authorities count on. Mr. Deng can cite the Cultural Revolution and much else to prove that the Mao way is a disaster. But will the Deng way work, as the West has every reason to hope? Mao's heirs are watching.