No. Patents don't care about code.
If FB has patents that cover parts of React, the same patents also cover similar parts in other projects, including your own.
By using React you prevent FB from using those patents against you within the project in which you use React instead of your own analogous code.
They can enforce their patents against you if you infringe on them in your code. They can't enforce their patents against you if you infringe on them by using React.
This is a protection you only get by using React. And it's the only thing that changes if you sue them over patents.
The only difference is that if you don't use React, depending on the exact patents, they might not be able to determine you are infringing on their patents without looking at your code (whereas if you use React they know which of their patents cover React).
But as I said, this "drawback" really pales in comparison to the very real risk of infringing on patents without even using React in the first place. Facebook might hold the patent for some ubiquitous aspect of your application and they could still sue you over that if they want to at any moment.
That said, if you run a software company and intend to sue Facebook over patents, you better believe that they have an arsenal that can take you off the market for good if they want to.
Besides, why would you want to use open source software created, maintained and sponsored by a company you're planning to sue?