Reactjs headless WordPress theme configure SEO

Which is the best way to solve it.

There is no WP based solution to solve this. Any WP solutions will modify the output of a WP theme, but you don’t have a WP theme. What you have is a React web application that talks to a REST API and gives the appearance of a WP frontend.

To be clear, your React frontend is not a WordPress site, and it is not a WordPress theme. It’s a pure JS frontend built in React that grabs content from an API.

You can ingest data from WordPress, but generating SEO tags, making your markup search engine friendly, that’s a pure React problem that has little or nothing to do with WordPress. There is no way for plugins to change your apps header tags, or other things.

This is one of the costs of going headless, you need to implement this yourself. As such, you can’t just add seo. Instead, you need to research what these plugins do, and reproduce it independently, or via libraries from the JS community.

Consequently, you’ll need to understand what it is that needs to be done, and there won’t be a 1 size fits all solution. You won’t find a JS library that does all the things you need, and will need to implement various things independently.

WP resources and communities will be of limited value as a result.