How to connect to D1 remote with React

Hello everyone, I create a React app by following: https://developers.cloudflare.com/workers/frameworks/framework-guides/react/ However, it starts the dev mode by using command npm run dev instead of wrangler dev The document https://developers.cloudflare.com/d1/best-practices/local-development/ said that we can use remote database by using command wrangler dev --remote
Note that wrangler dev separates local and production (remote) data. A local session does not have access to your production data by default. To access your production (remote) database, pass the --remote flag when calling wrangler dev. Any changes you make when running in --remote mode cannot be undone.
Note that wrangler dev separates local and production (remote) data. A local session does not have access to your production data by default. To access your production (remote) database, pass the --remote flag when calling wrangler dev. Any changes you make when running in --remote mode cannot be undone.
How can we connect to remote database when using React app? Many thanks
Cloudflare Docs
React
Create a React application and deploy it to Cloudflare Workers with Workers Assets.
Cloudflare Docs
Local development
D1 has fully-featured support for local development, running the same version of D1 as Cloudflare runs globally. Local development uses Wrangler, the command-line interface for Workers, to manage local development sessions and state.
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?