问题
I am wondering if anyone can show me how to connect my react app create with create-react-app to connect to a local mysql database. Is there any library out there that does this or do I have to start completely from scratch?
回答1:
You're going to have to build a server with API routes to query the data from your database.
回答2:
You need some sort of backend server script build with language such as php or nodejs that will create api endpoints to be consumed by your react scripts
来源:https://stackoverflow.com/questions/42865650/how-do-i-connect-to-sql-database-from-react