Navigation On The web react-navigation - react-native

So i was wondering is there a comprehensive example or library out there that one could use for navigation on web as well as native side.
Maybe a working example one could try out with modal, drawers, and all that fancy stuff.
What is it like using react-navigation 3.0 for web? Is it fully compatible? Is there an example online one could work with and draw inspiration from?
The example on react-navigation documentation is pretty contrived and not really clear, is there someone who has worked on such project.
Thanks.
Here are a few sources i have come across.
https://blog.bitsrc.io/how-to-react-native-web-app-a-happy-struggle-aea7906f4903
How about using an HOC as provided in the above case?
Seems like a neat solution.
https://pickering.org/using-react-native-react-native-web-and-react-navigation-in-a-single-project-cfd4bcca16d0
https://reactnavigation.org/blog/#ecosystem-and-web-support
https://reactnavigation.org/docs/en/web-support.html

There is no perfect example of rn-web plus r-navigation.
Have a look at: https://github.com/react-native-elements
PS:Honestly this is (for me) a dependency hell "r, rn, rn-web, rn-dom, babel, expo, expo-cli". Frameworks & repos owners around the RN topic do not seems too concerned about the react-native-web topic anyway.

Related

How to use microfrontends with Vue/Nuxt?

I wanted to know how to use Microfrontends with Nuxt or at least Vue.
Is there a plug & play simple solution to have it working quickly?
I've heard about Webpack's v5 ModuleFederationPlugin for example, is this a valid thing to start my Nuxt project?
As of today, Nuxt2 is still using Webpack4 so ModuleFederationPlugin will not be a possible solution.
Nuxt v3 will come with Webpack's v5 support and you'll probably be able to try it then. I also heard that the same could be used with Vite btw.
As a general answer, you need to understand that a Microfrontend is not something simple to do. It is more about how you do structure your app in the larger scope.
It's like having a micro-service on the backend: it can be done is multiple ways and it all depends of the needs of the company/team.
If you do create a Vue2 or Vue3 project with the Vue CLI, you'll still have Webpack v4. You can probably try to make the upgrade yourself if planning to use ModuleFederationPlugin.
As an alternative, there is single-spa. This is a way of doing it (probably not the only one).
Here is a podcast show talking about the subject in depth: https://devchat.tv/views-on-vue/building-micro-frontends-with-lawrence-almeida-vue-160/
It may be relevant to understand the general way this is working and also the pro/cons.
If you're not satisfied with this approach, there are a lot of articles on the Web talking about Microfrontends and some Google-fu will be enough to give you an alternative way.

Technical difference between react-router-native and react-navigation

newbie here at React Native.
react-router is a popular library for navigation in web apps. This same library has a package that provides an API for navigation in RN, react-router-native. Docs
After reading react-navigation's pitch and anti-pitch, I am curious to understand the difference in the internal working of the two.
There are similar questions here and here, but the answers are opinionated and unable to point out the differences of working between the two.
Requesting any helpful information about the two libraries here! Any particular use case where one performed better over the other would also help!

What is the best solution for Local Notifications in IOS for react native?

As the React Native website informs us PushNotificationsIOS is now deprecated. What is recommended is using https://github.com/react-native-community/react-native-push-notification-ios. However, this project does not seem to be maintained or commonly utilized. Frustratingly, it lacks Typescript support.
I am having problems using a Notification Content Extention for some nice custom iOS notifications. I suspect this has something to do with react-native-push-notification-ios's use of now deprecated UILocalNotification. Like many projects in the elephant graveyard that is the RN ecosystem, it seems painfully out of date. I'm reluctant to further troubleshoot my issues because it seems like a lonely, time consuming and potentially fruitless effort. Additionally, I'm trying to avoid writing a lot of native code.
Is there a solution I am missing here? Or am I asking for too much native support from React Native?
I always use firebase for my notifications. It works really well in my opinion. https://rnfirebase.io/docs/v5.x.x/notifications/introduction

Is it possible to use tenserflow.js with react native?

I am trying to add offline support to an AI-based app I am building on React Native, The app is similar to Not Hotdog of Silicon Valley. I recently found out Tenserflow.js and tried to implement it with React native and even outputted my python model to the one that is supported by Tenserflow.js but when I try to import Tenserflow.js inside one of the React Native components using import * as tf from '#tensorflow/tfjs'; this syntax but React Native throws the error, the error screenshot is attached with the question.
Thank You !!!
The short answer is no as stated in the description of the project.
A WebGL accelerated, browser based JavaScript library
The error you are getting shows that it's trying to use window which is part of the DOM API in browsers. React Native has no such API as it's not a browser. You can see that they use window in multiple places in their Core API.
The long answer is a maybe but is out of scope for a StackOverflow answer as it would be akin to asking for a tutorial. To elaborate, I can see two approaches to possibly getting TensorFlow.js to work:
Polyfill everything that is missing:
This might be possible but it probably won't work as you'd expect because it leverages WebGL. I'm not familiar with TensorFlow.js, but I would believe that WebGL is used because it would allow access to GPU acceleration making the workload feasible in the browser. You would need to do something similar in order for it to work well on a mobile device.
Leverage a WebView. However, you may again run into WebGL/performance issues as indicated in older questions such as this.
Since you didn't post any code whatsoever, there is no other guidance that I can give you on this question. One suggestion would be to look at maybe a native module such as react-native-tensorflow and the discussions people had around it.
#tensorflow/tfjs-react-native has been available on npm (in alpha) since late August 2019.

What navigation component to use in react-native for IOS?

I thought navigation-experimental was the latest one and I saw some posts which says it is deprecated in V0.43. So which navigation component to use in IOS, If I want to start today ?
Update:
There is no right answer to this question. But personally I prefer react-native-router-flux. But there are too many ones which makes difficult to choose.
You can also check reactnavigation. I hav not tried it yet personally but it seems promising.
Have a look at this one - https://github.com/wix/react-native-navigation.
It has good API and is well maintained.
I haven't used it myself though. The one I use is https://github.com/aksonov/react-native-router-flux
I think the best way to get started is on Exponent. Ex-navigation is great for beginners.