I'm currently learning React Native and I've created a small app where I can send events from my Objective-C code to the React side of things.
I'm struggling to understand how to asynchronously send events from React to a listener on the ObjectiveC side.
I feel I've probably misunderstood a critical part about the Bridging as I'm struggling to search for the correct thing (if it even exists). Could someone please pointe in the right direction or if this is even feasible.
Managed to find the answer. I was searching for the wrong thing (newbie mistake). Here is a link that helped me: https://facebook.github.io/react-native/docs/native-modules-ios.html
Related
I'm trying to get an effect like youtube's one in the ScrollView of my react native app.
I don't really know how to search for this, so if anyone knows of a package or a video tutorial that could help me, I would really appreciate it.
That's a short video showing the effect I've said, but I believe it is present in all Youtube apps.
Basically, it shows you the header when you drag it up from anywhere on the screen.
I'm trying to implement automatic subtitle generation in a React native app and I thought about a subtitle approach via streaming.
Calling some Google speech service, azure, etc ... and translating in real time that the video is playing
But I'm a little lost on how to do this with react native, could you help me?
Does anyone have any ideas or a lib not free that would solve this problem of automatic subtitle generation?
Have you been through this?
I've been digging deep in React Native for the past week to decide if I and the team should adopt it. And I gotta say it seems promising. I've also learned about its ability to integrate with existing native projects and its incremental adoption to change existing native projects.
My question is what are the cases/reasons that would make me wanna convert my completed old native projects (iOS/Android) into React Native?
Edit: Just to clarify, our team is currently building native apps only.
It depends on what type of app you are building. But you can always use bits of code from native or react native. Since you all can code in native, anything you cannot find you could make a native component.
The advantages of React Native show up with code reuse between iOS and Android so that your team can iterate faster working together. Many big apps have achieved 80% or more code reuse.
You will find flexbox so easy to quickly create views to specs and to change quickly with styles. Plus they are all in code and that plays nice with git.
See edit below:
Now in saying this I have never used React Native inside a native project but to call actions and such you would need to expose functions to call from the JavaScript side. I don't know if a singleton is generally used or just an import of the controller functions or delegated you want to expose but it has to call back to the native application . It is easy to use a native component inside a React native application and I have done this so I am sure it can work the other way.
Edit: Out of curiosity I added some react native views to a test project and it works surprisingly well. No singleton needed Javascript maps the view tag and the exported functions. Crazy. The concerns below still exist but I think if you are changing to change that is wrong but if you have UI changes you want to make then it could definitely benefit as your reuse can grow across your platforms.
Drawbacks I have seen- sometimes transition animations can be laggy if you are not using the native navigation methods. Using both native and React Native adds size to your app so you would need to keep an eye on that. Also start up time can hurt and so monitor that as well.
With all that said I have built a fair bit with React Native lately and it is, at times, beautiful and frustrating for a native developer.
Here is a great article on Instagram and React Native.
Also AirBnb heavily uses RN. They may be completely RN now but I am not sure. They do drive a lot of the outside frameworks in RN for example the maps component in RN. They also just released Lottie and it is very cool. Here is an article about AirBnb.
I'm building my first mobile app and am loving what React Native has to offer. One major disadvantage I've encountered is that the Navigator does NOT unmount the scene when a new scene is pushed on the stack. This makes some sense as this is probably necessary for transitions to happen smoothly.
My app uses a video background and seems like other apps using large media files may encounter a similar issue of high and unnecessary resource usage due to this behavior. Maybe a better approach would be to unmount the scene after transition and remount before popping?
I wonder if others have experienced similar issues and may have some feedback. I've already tried ExNavigator and React-Native-Redux-Router. These libraries are just not mature enough for my use cases and seem to have trouble working with Hot-Reloading.
Thanks for reading and replying.
I wouldn't use React-Native-Redux-Router, its not mainted and was taken over with React-Native-Router-Flux, i used to use RNRF, but have swapped to exponents ex-navigation (https://github.com/exponentjs/ex-navigation), and stay away from Navigator if you're going to start wanting more "complex" apps, as it is no longer maintained, though it does work still.
Which ExNavigator did you use because exponents one is well maintained and extremely fluid so far for what I have been doing, and should fit for most use cases.
If you want to stick with Navigator have you tried replace(route) or the resetTo(route) though you won't have transitions
I'm interested in using a slide-out vertical navigation in an app using react-native. Is there a trick to this, or is it just a matter of creating a View and adding CSS that makes it respond to a button-tap or a swipe motion?
I've gone through the UIExplorer example in the Github repo, and did not see this style of navigation within it. I am new to react (and react-native, of course). I'm not having trouble with the tutorials I've gone through, just curious if there's a "React Way" to do this, or if I ought to just hack along until I get something working. Thanks.
I work on the <Navigator> component for React Native, and I think it might fit your needs.
Check out the documentation here: http://facebook.github.io/react-native/docs/navigator.html
And the example code in UIExplorer: https://github.com/facebook/react-native/blob/master/Examples/UIExplorer/Navigator/NavigatorExample.js
The navigator is still a work in progress, so feedback is welcome! (you can file an issue on Github and tag me, #ericvicenti)