Your iPhone Is Overheating While Charging
It’s perfectly normal for your iPhone to heat up a little when it’s charging, but if you feel it getting so hot you can barely touch it, that’s not a good thing. Overheating while charging can cause permanent damage to your iPhone’s battery, so you need to take it seriously if your iPhone starts to get really hot when you plug it in.
First, as a general rule, it’s best not to use your iPhone while it’s charging. It’s okay to pick it up to check your email or dash off a quick text, but you should definitely avoid demanding apps like games. If you find your iPhone getting hotter while using it, let it charge with the screen off, and that might fix your issues.
You also need to take the temperature of the surrounding environment into account. If the room where your iPhone charges is too hot, that’s not going to help, and your iPhone may even stop charging until it gets back to a normal temperature. Change the room where you charge your iPhone or move it to a cooler place, and by all means avoid placing it in direct sunlight.