Hacker News new | past | comments | ask | show | jobs | submit login

I've ran through most of the intro doc, but I'm still not sure if Exponent supports invoking platform/system APIs? E.g. if I want to access clipboard contents, or wifi network configuration, etc, how can it be done with Exponent? With React Native, I can write corresponding functionalities using Java or Swift/ObjC, and then integrate it with the RN main app, but how can this be done with Exponent?



Hi-

Exponent exposes all of the React Native built-in APIs which encompass a lot of what you're asking about.

For example, here is the Clipboard API: https://facebook.github.io/react-native/docs/clipboard.html

Wifi network configuration is more complicated, but there are some things exposed like "NetInfo" which lets you know the current state of connectivity. https://facebook.github.io/react-native/docs/netinfo.html

The complete React Native docs are here: https://facebook.github.io/react-native/ and Exponent specific docs are here: http://docs.getexponent.com/

For now, Exponent just lets you write things that only use JS, and we make that easy and reliable and straightforward. We actually think this is the best way to write most apps that can be built this way since the code is easier to maintain and works cross platform, and you can do things like instant updates much more reliably when all your code is JS.

We're looking at a way you can write Java/Swift/Obj-C extensions for Exponent, but that will take us some time.


Thanks a lot for the explanation. I'll try out exponent and see how far I can go without resolving to native :)


Hi Fred, I work on Exponent.

With Exponent you write just JavaScript. In addition to most of the APIs that come with React Native, Exponent provides several APIs (https://docs.getexponent.com/versions/latest/sdk/index.html) and we're steadily adding more. If there's a native API we don't have yet that developers need, they tell us about it and we add it to our roadmap.

Exponent is open-source, too, so if you needed to you could fork it and write your own native code or make a raw React Native app. We recommend writing pure JS apps if you can, though. At Exponent we write native code so other people don't have to.


This is great, good to know the options are there, can't wait to try it out!




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: