Can I host my React Native app to my website using cpanel? - react-native

I'm currently developing a website using React Native, when I read about React Native I got the info that React Native can be used as both a web application and a mobile application, so I tried it.
Currently, my website is finished and can be run on localhost
but right now I have a problem when I want to host the website using Cpanel.
Previously I wanted to ask, can React Native be hosted as a website?

Run Following command in your project
expo build:web
it will generate web-build folder. inside build folder all your static, assets, js and html files are located.
now its time to upload you static file to c-panel
open your c-panel account and go file manager and select your domain where you want to go live with web-build (react-native-web).
Upload web-build's folder content to your it will take few minuts and you can visit your domain your site will be live on specific domain

Related

Can React Js application be hosted on S3 bucket

I thought we can only host Static websites onto S3 bucket.
How can React Js apps be hosted onto S3? React pages are dynamic in my understanding. The content of the page changes based on the user choices made on the page. Isn't that correct?
thank you
React pages are dynamic in my understanding.
Your definition of "dynamic" and S3's definition of "dynamic" are not the same thing.
Everything that's changing in the React application is happening in the browser. It's just the browser running JavaScript code. Nothing on S3 prevents a browser from running JavaScript code.
What they mean is that you can't have dynamic server-side content, such as a Node.js application or a PHP application.
The React application is served to the user by static HTML/JavaScript/CSS files.
React is a Single-page application (SPA) with browser -side rendering. A Single-page application (SPA) is a web application implementation that loads a web document and updates it by using JavaScript APIs in the browser. In simple terms, when a web application written in react works, the browser download the application files and run it using JavaScript on browser with the support of react libraries. Therfore the content in react app (min.js files and other assests in a production build) are not changing with time. A static storage and a public access(url) is the sufficiant to host a react application. So it can be host in a S3 bucket or github-pages or similar static storage without any computing power.
In a react webapp what's dynamic is the rendering of HTML elements using javascript. A dynamic web application refered by AWS is a one with dynamic server side rendering as Node.js. You can refer this guide to learn more on how to deploy a React application in Amazon S3.

How to load a particular page shared as link in react native app webview (deep linking)

I have a react native app which uses react-native-webview to load my site. I have setup deep linking for both android. Now when we try to open a link shared via slack or any other app for example: https://example.com/some-link, it opens my app but does not navigate to the particular shared url or the correct page.
I have tried OnNavigationStateChange, OnLoadStart, onShouldStartLoadWithRequest but not able to get the url that has to be opened.
Any suggestion or help is much appreciated
Thanks you

How do I create a http redirect url for react native expo app?

I have a third-party OAuth in my react-native expo app.
I need to specify a https redirect url to the third party website to come back to my app. Right now when I am running my app on expo - I am using auth.expo to redirect to the app and it works fine.
Now, when I want to run it as an independent app, how should I set up redirection in it?
I have searched a lot for it and the solutions that I have found said to modify the AndroidManifest file which is not there in app created via expo.
Can you please guide on how should I proceed?

Is it possible to use react-native-web to create PWA?

We are creating a web site which we want to use RN-web. (it's back port from RN app)
We'd like keep the possibility of converting to PWA later, wonder if it's possible to convert RN-web to PWA?
If you created your application with the expo-cli, now it's super easy to do it.
Expo web projects generate PWA assets and manifest by default, you only need to enable offline web support to get a full PWA.
You can follow the documentation https://docs.expo.io/guides/progressive-web-apps/
And enable service workers on your react native app https://github.com/expo/fyi/blob/master/enabling-web-service-workers.md

Where to configure deep link URL schema in React Native / Expo

I want to create a deep link in my react native app so a user can share a URL and then the other person can open this url and have the intended app open.
I am following this tutorial and they say info.plist needs to be edited with a URL schema.
However, I believe this is only for IOS? And also I don't believe I have access to these files when using Expo?
How can I specify my url schema and achieve deep linking in Expo?