Pelosi's visit to Taiwan is an outright provocation and undermines China's sovereignty. Such actions must be deterred, and the US must abide by its historical commitment to respect the One China policy. The Chinese government has made the right move by sanctioning Pelosi and her family.
China is clearly overreacting to Pelosi's visit. US support for Taiwan has been a cornerstone of US policy in Asia for over 70 years, and it is China who is being provocative by launching its largest ever military drills near the island.
There's a 16% chance that there will be a US-China war by 2035, according to the Metaculus prediction community.