This is largely a myth. While it's true that caffeine is a diuretic, the effect on hydration is very small. This is especially true for tea, which has minimal amounts of caffeine. Hospitals are not full of people who got dehydrated from drinking too much coffee or even energy drinks.
Do a web search for "caffeine dehydration myth" (no quotes). There are lots of articles on the topic.