David A. Andelman, executive director of The RedLines Project, is a contributor to CNN, where his columns won the Deadline Club Award for Best Opinion Writing. Author of " A Shattered Peace: Versailles 1919 and the Price We Pay Today ," he was formerly a foreign correspondent for The New York Times and CBS News in Europe and Asia. Follow him on Twitter @DavidAndelman . The views expressed in this commentary are his own. View more opinion on CNN.

(CNN) One of last military initiatives of the George W. Bush presidency was the creation of a new joint military command for Africa, called AFRICOM. The establishment of the organization reflected the recognition that, for the first time, powerful elements on the continent did represent a tangible military threat to the United States.

When the agency was activated in October 2008, ISIS was a growing force in the Middle East and looking for new fields to spread its reign of terror elsewhere, especially into Europe and Africa . In the decade it took to bring ISIS fully to heel in Iraq and Syria, the terrorist group became well implanted in Africa, which it likely saw as a new and relatively secure base.

In its annual report on terrorism released in October, the State Department singled out Africa as a key location where operations of terrorist groups were on the rise, unlike in Syria and Iraq, where they were on the run. In addition to ISIS presence in Africa, the decade saw the emergence of Boko-Haram, the group which originated in Nigeria but has spread far beyond , and other splinter groups, ranging from ISIS-aligned Islamic State West African Province (ISWAP) to the rival Shekau faction -- all of them embarking on widespread, violent attacks, kidnappings, and terrorist actions that spread death and destruction across sub-Saharan Africa.

In recognition of the new reality of terrorism in Africa, the US began building a $110 million drone base in Niger in 2016, and had deployed more than 7,000 troops across the continent.

But now, according to unnamed officials cited in the New York Times, Trump and his defense secretary, Mark Esper, are looking at dismantling some, perhaps even all, of a security infrastructure in West Africa so carefully and expensively assembled over the last decade. If they do this, they would be hanging out to dry part of a continent faced with the unchecked spread of terrorism and American allies still fighting daily battles there, all the while giving comfort to ISIS and a host of other terrorist groups.

Part of this projected withdrawal is likely rooted in Trump's ignorance about, and expressed disdain for, the African continent. The President of course referred to many African nations as " shithole countries ," according to sources familiar with the meeting who were cited by CNN, and he has yet to make a state visit to the continent. When former National Security Adviser John Bolton detailed America's Africa policy it was expressed largely as a competition with China and Russia, whose presence is surging across the continent just as Trump is contemplating a major retreat.

The decision can also likely be traced more deeply to Trump's utterly transactional view of foreign and military policy. With Africa, in his view, having little tangible impact on American interests, and with no other nation in a position to foot the bill for American deployments on the continent, there is little reason to remain.

But, of course, Africa does have a tangible impact on American interests. An American pullback would leave a large hole that China and Russia would be only too happy to fill. China has already established a major beachhead in East Africa with a massive naval facility in Djibouti. And as early as 2015, the Pentagon's African Center for Strategic Studies reported that China was already the second-largest supplier of arms to sub-Saharan Africa -- after Russia . Both countries have invested broadly in the continent, seeking to win hearts and minds, with Chinese leader Xi Jinping even making a swing through a number of key countries last year.

But an American withdrawal would also leave a hole that France, the other large Western presence on the continent, would be hard-pressed to fill. Many African countries where terrorists have taken the deepest roots -- particularly in West Africa, like Mali, Niger and Chad -- are former French colonies with large French-speaking populations, and in whose security France has continued to maintain a real and tangible interest. But without at least the logistics, electronic intelligence and drone support from American forces, France would have trouble stemming the expansion of terrorist groups.

Just last week, French president Emmanuel Macron took time away from France to fly to the Ivory Coast to meet with eight West African leaders and give his support for a new African currency, while at the same time vowing to remain "united to face the threat" of Islamic terrorism. I can only hope that Trump's new determination to flee Africa is not based in any fashion on the disrespect he saw from Macron at the recent NATO summit in London.

Trump's foreign policy approach frequently reduces key diplomatic or military issues to transactional questions of dollars and cents. He has reportedly demanded that South Korea pony up 400% more than it is currently paying to help foot the bill for nearly 30,000 US troops deployed there to keep North Korea at bay. And his administration has also pressed Germany to raise its level of defense spending, pointing to the large deployment of US forces there that could be partially withdrawn.

Get our free weekly newsletter Sign up for CNN Opinion's new newsletter. Join us on Twitter and Facebook

The big question, in the end, is how one can measure security in dollars and cents. The truth is: Neither easily nor realistically. AFRICOM was established to fill a tangible security vacuum. Even with their efforts, that vacuum has only grown broader and deeper in the decade since significant numbers of American forces were deployed across the continent.

To remove them now, suddenly, with no alternative in place, will only give new encouragement to many of the most dangerous forces there, which would quickly become impossible or far more costly in money and lives to contain.