Detect when a page loads in React - reactjs

Is there a callback that is called when a react "page" finishes loading?
BACKGROUND: I have an Android webview that does some stuff when the page fully loads. It works great for normal web pages, but for react apps the webview only triggers the "loadComplete" callback when the app loads for the first time. I'd like to detect something similar for React apps, especially after the Back button is pressed.

Related

Use Ionic Portal inside Ionic Framework React Native Apps? (Webview inside Ionic App without covering up IonTabBar)

I have a use case where I would like to leverage some existing pages from a Shopify powered store inside an Ionic Framework v6 React iOS / Android App (on web we will simply redirect to the appropriate subdomain). Unfortunately, Shopify has their iFrame options set to Deny so using an iFrame is not an option.
Image of where the Shopify Store should show up in my app
I've looked at the various flavors of inAppBrowser, and while this allows me to show the page, its a pretty jarring non-native app experience. What I really want is an Ionic React Component for Native that will allow me place a webview under my control constrained to a certain viewport of the page.
Ionic Portals are targeted at Native developers with fully native code bases but actually show this use case on the home page:
Image of Ionic Portal webview inside Native Tab Bar Application
I know portals are pretty new and I haven't seen any documentation about this but is it possible to use them inside of an Ionic React App to accomplish the behavior I want (or something in inAppBrowser or another plugin that I've missed?)

How to load spash screen when app loading from background in react native expo

I'm using react native expo to build a app. I have faced a big problem right now.
I want to load splash screen when app is loading from background.
scenario,
When I open app, it load splash screen, then go to home screen.
Then use hardware back button to go to app background then again open app
Right now when I load app from background always show home screen before load splash screen
I try to kill the app when use hardware back button using `BackHandler.exitApp()` its not killing the app.
I want to load splash screen first and then go to home screen.
Can any body help me to fix this issue
You can refer to the Expo Documentation on SplashScreens https://docs.expo.io/versions/latest/sdk/splash-screen/ and https://docs.expo.io/guides/splash-screens/. If these aren't as helpful, you should post a code snippet of your main App screen and the code which you used to integrate and hide the splash screen when the application loads.

Put React application inside another application

For react application I have to build sidebar menu and appropriate content on right side with dynamic content through navigation. This part is completed and now there are more menus in sidebar in existing application which are developed in different language and that should also be seen exactly like same sidebar and redirect to appropriate pages.
Block 1 will have only my react's application and block 2 can be page from react app or another app according to the navigation from sidemenu.
How can I achieve this?

ReactJS project on Android WebView, Image not showing

I am currently experimenting on a hybrid app using ReactJS for my front-end loaded inside an Android WebView. On one of the pages, I have a list that loads an external/hosted image. Tapping on these images routes to another page that shows its description (using react-router. history=hashHistory).
Testing on the browser(chrome), the images appear once loaded. On the other hand, testing on the actual device, the images does not appear. Only when I tap the list item and press back (hashHistory.goBack) that it appears.
I know this is not the best use for ReactJS, but this is better than what we are currently using. Also, our current setup prevents us from pursuing the React Native way. Any ideas?
EDIT:
here's a screen cap:
You need to change your websettings in your code.
WebSettings settings = webView.getSettings();
settings.setDomStorageEnabled(true);

Unable to handle back button navigation issue in hybrid apps

We have developed an hybrid app using phonegap in pure HTML stack (HTML, css, javascript). Currently we are facing issue with device back button navigation. Generally in any native apps such as android, on pressing back button the app moves to first screen and then exits the application or exits directly. But, we are not sure on how to handle this behaviour in angular js. As per current behaviour, in our application on pressing back button, it moves to previous screen and then to its previous and thereby navigates to different screens without exiting. So, we are not sure on how to handle this behaviour.
document.addEventListener("backbutton", onBackKeyDown, false);
function onBackKeyDown(e) {
e.preventDefault();
}
in the onBackKeyDown method, navigate where you want or your login.

Resources