Just wanted to add my experience incase it helps anyone.
I am using a Sanity CMS + Gatsby set up which comprises of a root folder containing a web and a studio directory. I was forgetting to delete the package.lock and node modules folders from all three and was therefore getting conflicting react version errors. So remember to check in all of your project’s directories.