If you want to use React, use something like Nextjs or Gatsby to compile it into a static HTML website.
Gatsby doesn't compile to a static HTML website. It compiles to a static site. There's a subtle difference. The pages are rendered on the server and served as static assets, but the entire React routing and content loading is still there. When a visitor loads a page it renders and then gets turned from plain HTML back in to a React again. When you navigate from one page to the next all the content for further pages is preloaded. You are not loading a full HTML page for each link you click on (which is exactly what makes it feel so lovely and fast - everything is being preloaded behind the scenes).
I've built API powered React sites with almost no consideration for SEO that Google has indexed without issue. My experience has been that as long as the API requests for content are quick Google is happy to wait and index correctly as expected. YMMV obviously.
Single-page apps (SPAs) using client-side rendering (CSR) like React do get indexed by Google, it's just not instant. Depending on how long it takes for the content to load, the Googlebot might not be able to figure out the correct on-page SEO.
If SEO is a critical requirement, I'd recommend either server-side rendering (SSR) through a framework like Next.js or completely static sites through whatever framework you prefer (Next.js, Gatsby, 11ty, Hugo, Jekyll, etc, etc).
Gatsby doesn't compile to a static HTML website. It compiles to a static site. There's a subtle difference. The pages are rendered on the server and served as static assets, but the entire React routing and content loading is still there. When a visitor loads a page it renders and then gets turned from plain HTML back in to a React again. When you navigate from one page to the next all the content for further pages is preloaded. You are not loading a full HTML page for each link you click on (which is exactly what makes it feel so lovely and fast - everything is being preloaded behind the scenes).