WASHINGTON — President Trump on Sunday announced plans to travel to Texas on Tuesday, as millions of people there continued to battle catastrophic flooding and torrential rain that was expected to last for several more days.

The timing of a presidential visit, as the disaster was still unfolding, could put Mr. Trump in an awkward position of adding to the logistical headaches for state officials, though he may avoid the storm-ravaged parts of Texas. The White House emphasized that the president’s plans were tentative and could still change.

But his Twitter feed and the photos and statements released by the White House indicated that Hurricane Harvey and its aftermath had energized Mr. Trump, giving him the first major external crisis of a presidency that has manufactured most of its own upheavals.

On Friday, as the storm began lashing the Gulf Coast, Mr. Trump posted several updates on the status of the storm and lavished praise on the government’s response. He held two teleconferences over the weekend with members of his cabinet and signed a federal disaster proclamation for Texas.