The rule of law is being eroded. An increasingly authoritarian regime is undermining democracy. The European Union is pondering sanctions, and an increasingly bitter war of words is breaking out.

The battle between Poland and the rest of Europe is getting more and more intense with every week that passes. And it is not just Poland. Hungary and, to a lesser extent, the Czech Republic are starting to feel the heat as well.

You might think that investors would be steering well clear of that kind of mess. After all, who wants to have money tied up in an economy that may ultimately be cut adrift from its main markets?

But you’d be wrong. In fact, the bad boys of Europe are all doing fine.

The Polish market is one of the best performing in the world right now, and the Hungarian and Czech bourses are doing pretty good as well. In reality, the EU can huff and puff, but the ‘”populists” in charge of those countries are doing a perfectly competent job of managing their economies. Investors should ignore the political noise, and get in while they still can.

When it is not arguing with the U.K. over the terms of Brexit, the EU is increasingly rowing with Warsaw instead over Prime Minister Beata Szydlo’s increasing grip on power. Over the last year, the EU has been growing more and more critical of the political control of the judiciary by the ruling Law & Justice Party. In the latest twist, the president has vetoed moves to replace the entire Supreme Court, which hardly looks good.

In fairness, it is a more complex issue than most of the country’s critics admit. Most countries struggle to find the right balance between the independence of the judiciary, and some form of democratic control. Polish democracy is less than three decades old, so it is hardly surprising if it needs some tweaks to the 1989 settlement.

Even so, the EU is taking a hard line. It is threatening to impose sanctions on the country, with France’s new President Emmanuel Macron most vocal in pushing for that. In the first instance, Poland could face fines. Over time, it could find itself frozen out of decision-making within the EU.

And ultimately? It is hard to see how Poland can remain a member of the Union if the conflict is not resolved — relations are now worse than they were with Britain in the run-up to Brexit.

Likewise, in Hungary, President Viktor Orban is on a collision course with Brussels. He has been threatened with sanctions over restrictions on foreign pressure groups operating in his country. Like Poland, there has been a long-running dispute over the rule of law. And as the EU tries to distribute migrants fairly around the Union, the Hungarians are refusing to take any, and so are the Poles.

Even the more liberal Czech Republic has been caught up in the turmoil – it too is facing sanctions over its policy on refuges.

But if you look at the stock markets, you wouldn’t think these countries had any problems, and certainly not a bitter dispute with their main export market.

The gleaming Galeria Krakowska Shopping Mall in Krakow reflects the rapid growth in Poland. Getty Images

Take Poland. The benchmark Warsaw Stock Exchange Index WIG, -0.42% is up by 20% so far this year, and had risen by 35% over the last 12 months, making it one of the best-performing emerging markets of 2017. That shows no signs of slowing down. Over in Hungary, the Budapest index BUX, -0.87% is up 12% so far this year, and by 30% over the last 12 months, while in the Czech Republic the Prague bourse FPXAA, -1.12% is up by 10% since January and by 20% since last summer.

In some respects that is surprising. These countries are critically dependent on their relationship with Brussels. A massive 77% of Polish exports go to the EU, with Germany alone accounting for 26% of everything it sells abroad. The Czech and Hungarian figures are only slightly lower.

In effect, these countries are manufacturing hubs for the EU. No one is talking about economic sanctions yet, or restrictions on trade, but if the rows keep escalating it is hard to see where else it can go. Even losing its voice in the EU’s decision-making process will come with a price tag attached — the rules will no longer be set with any regard for what matters for countries like Poland.

U.S. Flexes Military Muscle After North Korea ICBM Test

The reason the equity markets don’t care, however, is simple. The fundamentals are strong, and getting stronger.

Poland grew at 2.8% last year, and the World Bank forecasts that will accelerate to 3.3% in 2017. Hungary expanded 2% last year, and is forecast at 2.8% for this one. The Czech Republic is forecast at 2.9% for 2017. That is not turbo-charged Chinese growth. But it is a lot better than most of the developed world.

In Poland, Law & Justice might not have many friends around the world. But its mix of competitive markers, and strengthening its attractiveness to global investors, while boosting welfare spending to support domestic demand and improve its demographics, is a pretty good policy mix.

It should be enough to keep Poland growing for a long time. It is already the eighth largest economy in the EU, and it would hardly be surprising if it overtook Spain and perhaps Italy unless that country can break out of terminal decline. With the U.K. on the way out, it could eventually be the EU’s fourth or even third biggest member — and that will give it a voice.

Hungary and the Czech Republic look just as good.

There will of course be bumps on the road. There will be battles ahead, and lots of arguments. Over the long term, it is debatable whether countries such as Poland and Hungary will ever feel comfortable in a Franco-German-dominated EU, or whether, like the U.K., they will eventually want out.

But none of that need worry investors. It is just noise. The bad boys of Europe remain its most dynamic, fastest-growth economies — and the best ones to back for the next decade.