The snarky answer would be that that is true of any ship, so why build them at all.
Snarky? Yes. Correct? Not so much.
It is however the reason why armour was abandoned.
A better answer is that you would data link to a UAV or another ship with working sensors. Or have redundant sensor capabilities. Most hits, unless aimed with a antiradiation warhead, don't actually knock out the sensors themselves. Stark, Roberts, Cole, all had their sensors survive the hits that crippled them.
Stark was hit by two contact fuzed exocets, the Roberts struck a mine, and the Cole was hit by a suicide bomb. Neither of these are air bursting, which is what a coastal battery would use.
Let's say a battery of 155mm guns opens up on you. Depending on who you're dealing with that can mean anywhere between four and fifteen guns. Let's also assume it takes about a minute for you to neutralise them (Notice inbound shells, backtrack, acquire target, slew guns, time of flight)
Most 155mm guns can manage about five rounds per minute in short bursts, so you're looking at as much as 75 airbursting shells.
If you're unlucky and they have something akin to the Archer which can pour out 10 rpms you're looking at twice that.
In other words, plenty to cut up every single piece of unprotected equipment.
The problem was that they lost their engineering spaces so that while the antennas were working just fine, they couldn't get power to them. If you lose your antennas there are still options. If you lose engineering you are dead in the water. If you are already in range of enemy shore batteries you are just plain dead.
Indeed, but those options amounts to choosing which way you'll retreat. If anything this illustrates why you shouldn't move into 155mm range of the shore before it has been sanitized.
Name one ship since the second world war that was taken out of battle due to having its electronics knocked out. I can point to several that were taken out due to having their engineering spaces flooded or burned. HMS Sheffield, though she had her radar turned off at the time of the hit, was not hit anyplace near her antennas. I have already mentioned USS Stark, USS Cole, and USS Roberts, all engineering casualties with undamaged sensors.
\
Note ship listing, burning, but with antennas standing there just fine
USS Liberty, shot to pieces by aircraft and surface ships, torpedoed, burned and the radar mast is doing just fine.
The one case of sensor lost I can recall is from WWII when the South Dakota lost her radar at the battle of Guadalcanal. However; that was not because her sensors were shot away, it was because her generators were put out of action due to the shock of her own guns firing.
If loss of sensors is such a be all to end all, give one example where it has happened.
Name one ship that has been engaged by a shore battery that had access to air bursting shells since.
_________________
“Close” only counts with horseshoes, hand grenades, and tactical nuclear weapons.
That which does not kill me has made a grave tactical error
Worklist
Source Materiel is always welcome.