If you're a long-term investor, you don't need to worry about short-term trends. And while it's true the pandemic is turning out to be anything but a short-term problem, it's also not likely to keep the economy under lockdown for a decade, either. Although it's troubling to see COVID-19 case numbers rise due to the delta variant, that doesn't mean you need to drastically reconfigure your portfolio to maximize your returns under the current conditions.

Plenty of growth stocks are safe bets to generate great numbers over the long haul, regardless of what happens with COVID-19 in the next year or two. Three stocks that can be solid investments to hang on to for years, possibly even decades, are DexCom (DXCM 1.75%), Facebook (META 0.04%), and FedEx (FDX -0.85%).

A person wearing a surgical mask and headphones looks out at the world through a curtained window.

Image source: Getty Images.

1. DexCom

In 2018, 10.5% of the U.S. population had diabetes, and each year, 1.5 million more Americans are diagnosed with it. It's a growing area of concern for physicians and patients, as diabetes is a leading cause of death in the country. Patients couldn't neglect a chronic condition like diabetes during the pandemic, even though they may not have been able to see their doctors in person -- especially because contracting COVID-19 could also lead to more serious complications. That makes DexCom's continuous glucose monitoring (CGM) systems incredibly valuable tools: People with diabetes don't have to use finger sticks with a CGM, and it can help users easily stay on top of their glucose levels, sending them real-time readings.

Although many hospitals deferred procedures during the early stages of the pandemic, DexCom continued to generate strong sales numbers in 2020. Sales rose during the year by 31% to $1.9 billion from 2019's tally of $1.5 billion. Since 2018, the top line has risen by 87%. For 2021, the company projects that its revenue could top $2.4 billion, which would be a further 25% improvement from last year.

DexCom has also been working on a new version of its CGM. The G7 is smaller than the current G6, has a shorter warm-up period, and allows users to access their readings on an Apple Watch or have Siri read them out. Between the company's new products and a growing need for better glucose monitoring, DexCom is a stock that looks poised for much more growth in the years ahead.

2. Facebook

Facebook's business is versatile enough that it can do well regardless of the state of the pandemic. The company's revenue in 2020 totaled $86 billion, which was up 22% from the previous year; that growth rate was down only 5 percentage points from the 27% generated a year earlier, when sales came in at $70.7 billion.

In Facebook's most recent quarterly results, for the period ending June 30, its revenue of $29.1 billion grew at an even faster rate of 56% as the company benefited from greater demand for advertising. However, management cautions that this rate will "decelerate significantly," as future quarters will go up against some stronger numbers from last year. But with a 7% increase in monthly active users, now hitting 2.9 billion, it's still building off last year's already strong numbers -- that metric rose by 12% in the prior-year period.

There's some risk here related to antitrust lawsuits, which could lead to the eventual breakup of Facebook, Instagram, and WhatsApp. But with cash on hand of more than $64 billion as of the end of Q2, Facebook would have plenty of options to explore other growth opportunities if it needed to. This is not a stock I would worry about, as the business is as strong as ever.

3. FedEx

During the pandemic, consumers have been spending more money online than in stores. Data from Digital Commerce 360 shows that during 2020, consumer spending online with U.S. merchants totaled $861 billion. And the annual growth rate of 44% was the highest in more than two decades.

Those kinds of numbers will be hard to repeat if the economy fully reopens and people return to shopping inside brick-and-mortar stores. However, there's still lots of growth ahead; analysts from Grand View Research project the global market for third-party logistics -- including the delivery services that bring online orders to real-life people -- will continue to rise by a compound annual growth rate of 8.5% until 2028, when it will be worth just under $1.7 trillion.

In June, FedEx reported its year-end numbers for fiscal 2021, in which sales grew 21% year over year to $84 billion. While investors have been selling off the stock in recent months amid fears that shipments will decline as stores reopen, that won't negate the overall upward trend in online shopping and logistics.

A surge in delta cases and more restrictions may boost the company's deliveries in the short term. But either way, FedEx will continue growing over the long haul -- and that's why this is another stock you can just buy and forget about.