125 karma · joined Mar 24, 2018 (8y ago) · 39 submissions
twitter.com/fernandotherojo
comment 11mo ago · link · parent
Although it took a lot of effort, it was a new set of UI patterns for React Native, and it hadn't really been done well yet.
Where most RN teams go wrong is they never dip to native code. On the contrary, we wrote a lot of native code, both for our own packages and for updating RN core itself.
The benefits with React Native's composition model are hard to beat. For example, thanks to React's composition with hooks and components, we will likely be able to open source most of the problems we solved into an easy-to-consume library. Or at least that's the hope!
comment 11mo ago · link · parent
You can just use Share.share() from react-native directly for the share sheet.
15.
Solito 4 – React Native in the Next.js app directory(solito.dev ↗)
3 points · by fernandorojo · 3y ago · discuss
comment 3y ago · link · parent
Tamagui basically solves the part of styling + rendering UI. It works on both web and native.
As for logic/data fetching...this has gotten far, far better in React over the past few years.
For data fetching, assuming you're using REST, @tanstack/react-query is incredible. It gives you a "hook" to wrap any async function, and returns loading states, errors, etc.
In the past, people used Redux, but it's out of fashion now. I prefer a library called zustand whenever I need non-data related global state management.
comment 3y ago · link · parent
I built the first library for React Native that supported Web/responsive design (Dripsy), so it's cool for me to see Tamagui taking this idea to the extreme.
comment 4y ago · link · parent
The hardest part of sharing code between apps and websites, however, is the navigation code. Websites have flat navigation. You have one page mounted at a time. When you navigate to another page, the original one unmounts and a new one renders.
Native navigation has a different paradigm altogether. Rather than use simple URLs to account for most of the navigation state, native apps have complex tabs, stacks, and more. When you change tabs on Spotify, you expect the previous tab to maintain its state, scroll position, nested screen, etc.
Given all of these considerations, it's previously considered impossible to use the same code for apps and websites, even if they're all written with React.
Solito solves the navigation problem by offering a unified API across Web and Native. This lets you write your code one time with React Native, and use it on both iOS, Android and Web.
From the docs:
> Solito treats URLs as your source of truth. Your Next.js app and React Native app don't communicate at all. They live in total isolation. Solito works by doing this: give me a URL, I'll detect what platform you're using, and then I'll figure out how to navigate to the screen for that URL.
comment 4y ago · link · parent
That said, I'm sure there are good arguments for Capacitor!
comment 4y ago · link · parent
There are also experiments in the works to make React Navigation lazy load code with suspense on the Native side by bringing Webpack to Native: https://github.com/EvanBacon/expo-auto-navigation-webpack
Another added bonus of this approach is that it will have a pages/ folder API like Next.js.
I don't see why Solito won't be able to support these use-cases as they arise.
comment 4y ago · link · parent
I built our entire product from scratch for iOS, Android and Web. Rather than rushing to hire a team to do each thing, I felt that if I built the right abstraction layers, it could all be done by one person.
It can be a lonely road when you’re the only one, but Solito helps you feel a little less solo
comment 4y ago · link · parent
That said, I opened this discussion on the Remix repo a while ago: https://github.com/remix-run/remix/discussions/1578
If you're using shared screens outside of Remix marketing pages, though, then I imagine a solito/remix could exist to bring the same features the Next integration has to a Remix one.