I have a web application hosted on Heroku that uses PostgreSQL. I want to make a React Native application that can access that database.
How can I do that?
A typical architecture would be to add an API to your web application and have your React Native application talk to the API. I'm not sure how much obfuscation is provided by React Native, but generally speaking client-side code shouldn't contain sensitive information like database credentials.
I wouldn't recommend having multiple applications talk directly to the database, regardless of technology.
Having said that, Heroku does have some guidelines about how to access your database from outside of Heroku. Briefly,
heroku config:get DATABASE_URL to retrieve the credentials from your Heroku applicationThis is commonly used with graphical database clients, for example.