While it would certainly be devastating, do note that TSMC has fabs in places that aren't Taiwan. So their entire production wouldn't immediately go offline, and presumably China would still want to keep selling those products and would have an interest in avoiding destroying those factories.
If China suddenly decides it doesn't want to export electronics, though, then we're all super fucked. After all, what percentage of those TSMC chips flow through China to get mounted onto PCBs or need major supporting components from one of the "Foxconn Cities" in China?