Hacker News new | ask | show | jobs
by endisneigh 1752 days ago
React native I believe is the right approach given the current constraints, but I’d prefer that it would be possible to access native device apis via the browser.

Does Twitter really benefit a native app? Perhaps, but it’s certainly not necessary.

Ideally iOS and Android would simply expose native apis via browser and allow one to toggle access to said apis per site.

My conspiracy theory is that the only reason this isn’t already possible is due to vendors wanting more control.

3 comments

> Ideally iOS and Android would simply expose native apis via browser and allow one to toggle access to said apis per site.

Not when the different stores are so lucrative. Imagine that initially Jobs wanted people to stick to web apps and reserve native apps for Apple teams. fast foward 13 years, Apple made billions with their appstore.

With React Native Web, that's exactly what this gives you.

Basically you get a PWA for free with your app. All "native" features that you have can then use web device apis if they exist.

Basically React Native Web allows you to have a lite version of your app that lives on the web.

Yes, but then you must use React Native. What I’m describing is that you could use regular JavaScript to access native apis.

That way if you preferred Vue, Angular, Ember, Elm, etc you could use that.

Well you can, but the point of React is to abstract the view from the platform, not much more.

You can use something like Solid or JSX lite to maintain standard components that are compatible with most of those frameworks and web components.

Whether the view is abstracted from the platform and whether you have native access to apis are separate issues.

Even if you use web components that doesn’t change the fact that web apps don’t have access to native apis without compilation.

Have you seen expo? You can access native browser apis.
Yes, but that’s not what I’m describing.