Ask anything to Exponent
Ask Exponent about:
- Exponent XDE
- React Native
- Android & iOS app development
Hi everyone! Thanks for joining in and asking great questions. If you want to chat with us more, feel free to join our Slack: http://slack.getexponent.com/ and give Exponent a try if you haven't already! http://getexponent.com/
I think React Native works great already for many applications. Some things that are preventing it from gaining even wider applicability and adoption, I believe, are:
- ListView: no view recycling, so certain things (eg: contact views) are difficult and others (eg: feeds) use tons of memory.
- Gestures: difficult to have related gestures on a view, needs to be written monolithically right now using PanResponder.
- No high-quality, blessed solution for navigation -- this is problematic because the fragmentation leads to duplicated efforts and lots of confusion for newcomers. This is being addressed with react-navigation: https://github.com/facebook/react-native/wiki/Roadmap#core-libraries
- Many one-off native implementations of components that should just be implemented in JS. Often this is done because of some current limitation in React Native. For example: https://github.com/exponentjs/exponent/issues/14#issuecomment-262836018 -- rather than implementing a custom activity loading spinner natively, it would be better for people to find the underlying reason why they think they need to do that and resolve it. In this case it would be implementing Animated.loop and supporting
useNativeDriver: trueon it. This leads to people installing tons of libraries that end up not being maintained and having many more native dependencies than they need.
Share your programming knowledge and learn from the best developers on HashnodeGet started
The Exponent project roadmap is guided by the needs of product engineers. The feedback and requests we get from Exponent developers helps prioritize our projects across our mobile apps, APIs, and developer tools. One part of our APIs we get a lot of questions about is native modules.
I've been surprised by how much I like react-native-web. I actually find I prefer React Native development over React web development because of things like CSS-in-JS and having React feel more first class rather than just grafted onto the DOM. Excellent work by necolas.
I would be happy if someone build a tool for Exponent apps that would let them be easily targeted at the web via react-native-web, but we probably won't build it anytime soon.
We have a small team and our focus is supporting iOS and Android.
When people build for those things, there aren't always analogs for react-native-web that work, so lots of Exponent apps would feel really broken if you just tried to run them on a web browser with no changes.
A more straightforward way to target desktop computers would be for us to support the React Native on Windows and OS X targets. I'd love to do this as well, but its another thing we won't have time for anytime soon.
I do wish there was an easy solution to this though since so many developers end up frustrated when they have to build a mobile website and a mobile app, that end up slightly different. It would be a huge win for developers and users if it was possible to target iOS and Android native apps and also get a fully functional moblie website out of it as well; would be very tricky to get that right though.
Hi Justine! That's a great question, I'm glad you asked.
I think there are two key differences:
React Native itself gives you the core components that you need to build almost every app: Text, TextInput, View, Image, ScrollView, Switch, Slider, Touchable (the React Native equivalent of a link), ActivityIndicator, and a few more. It also gives you access to some useful APIs, like Geolocation and CameraRoll.
But what happens when you want to add a bar code scanner, map, Google sign in, Facebook sign in, video, fetch a user's contacts, add blur or gradient or OpenGL effects, SVG, push notifications, local notifications or sensors like gyroscope and accelerometer? In each of these cases, you will need to track down a native module that someone has implemented and published to npm, make sure it's actively maintained, install it in your project (not always easy! and you need to do it on both projects), update it each time you update React Native, or possibly just write it on your own in ObjC/Swift and Java.
So, we take care of this for you. Here's a list of some of the APIs that we support on top of React Native currently: https://docs.getexponent.com/versions/v11.0.0/sdk/index.html On Friday we'll publish another update that includes a handful more, and every release this grows. We test the APIs and update them for you, you don't have to think about installation except where an API key is required (eg: Google sign in), and you can expect it to just keep working as you update. If we do make some breaking changes, we'll list them in our release notes and you can update at your convenience.
#2. Makes React Native development even more like web development, for example in terms of publishing and sharing.
With Exponent, as soon as you create a project anybody in the world can open it on their phone and watch your changes live. When you want to deploy it, run
exp publish or hit publish in our development tool called XDE -- this will give you a permanent URL that anybody with the Exponent app can access. If you want to deploy it through the App Store and Play Store, run
exp build:ios and
exp build:android and we'll give you the store-ready binaries, then all you need to do is upload them (we'll be automating this part in the future too!).
It's really incredible how liberating this is -- to be able to share native mobile experiences in the same way that you would share websites. We (and increasingly, other people in the React Native community) use this all the time to share examples on the React Native Community Facebook group (https://www.facebook.com/groups/react.native.community/), for example:
We want to make building and sharing mobile experiences as fun and frictionless as it can be, we see ourselves as philosophically similar to now.sh and Ruby on Rails -- we want to remove the incidental complexity so you can just build cross-platform apps, no hassle.