2018 California's 21st congressional district election

Democrat TJ Cox, after dropping out of a competitive primary for the seat in California's 10th congressional district, chose to run against Valadao.

[2][3] Despite its preference for Democrats, Republican David Valadao won each of his three previous elections by double digits.

[15][16][17] FiveThirtyEight's rolling election forecast featured a "Lite" model which initially favored Cox based solely on national and local polls, including generic ballot national polls which showed Democrats significantly outperforming Republicans; however, its "Classic" and "Deluxe" forecasts, which took into account non-poll factors like candidate favorability, fundraising, and past performance, gave Valadao an edge.

[18] While most competitive Democrats were significantly outraising and outspending Republicans in the 2018 cycle, Valadao saw slightly greater fundraising totals than Cox in their election.

Valadao defended his votes, disputing Cox's claims about his Trump support and pitching himself as a "hometown public servant", and focusing on local issues like water rights.

[24] Cox argued that the migrants should go through the legal process of applying for asylum, while Valadao argued that most of the migrants were not fleeing violence at home but just pursuing opportunities in the U.S.[22] California elections are conducted with the use of both polls and mail-in ballots, where the latter are accepted any time so long as they are post-marked by election day.

[25] California's 21st is a primarily rural Congressional District, leading many to vote by mail rather than at a polling place that may be quite far away.

California did not certify its November 6 election results until December 14, with votes from the 21st district being received and counted through most of this period.

[27] This led the Associated Press, Politico, and other election analysts to call the race for Valadao, as the prospect of that lead being reversed seemed severely improbable.

[28][29] After all precincts reported their polling vote results, Valadao's lead shrunk to 8%, but was still seen as insurmountable with the given margins and projected remaining mail-in ballots.

On November 21, Valadao's lead shrunk to below 400 votes, with thousands left to be counted, and some analysts had retracted their calls.

Results by county:
Valadao—70–80%
Valadao—60–70%
Valadao—50–60%