An electronic device may have circuitry mounted on a printed circuit board. The circuitry may include electronic components such as integrated circuits, sensors, and switches that are sensitive to bending-induced stress in the printed circuit board. An overmolded plastic stress concentrator may be overmolded over the printed circuit board and the circuitry on the printed circuit board. A flexible plastic body may be used to enclose the stress concentrator and printed circuit board. The plastic body, stress concentrator, and printed circuit board may be elongated along a longitudinal axis. The stress concentrator may have unbent regions in which the printed circuit board is prevented from flexing and enhanced flexibility regions. Sensitive circuitry may be located in the unbent regions to prevent the sensitive circuitry from being exposed to bending stress.