You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To build a mobile app for Datenanfragen.de, we have decided to use React Native. The question now is how we want to do that, especially with regards to sharing code between the existing https://github.com/datenanfragen/website and the new mobile app.
Despite what the name might suggest, (P)react components cannot be used in React Native. React Native doesn't use HTML but has its own primitive components ("core components": <View>, <Text>, etc.).
Their philosophy is not "write once, run anywhere" but "learn once, write anywhere".
Thus, we won't be able to just reuse our existing Preact code in React Native.
There is react-native-react-bridge which allows using (P)react components directly in React Native but only through a webview. But honestly if we decide to go that route, it would probably be better to use something more mature like Cordova.
This essentially leaves us with three options:
Rewrite website in React Native. I'm quite strongly opposed to that.
Have the mobile app be a webview.
Extract as much of the logic and reusable code (hooks!) from website into one or more libraries but write a separate UI for React Native.
I'm leaning quite strongly towards option 3. My reasoning:
website isn't built as a pure Preact app, we have quite a bit of code in Hugo templates that we wouldn't be able to use anyway.
We are planning to majorly revamp the UI for the apps anyway, there is no need to port the current generator to mobile, for example.
Some of the new features we're planning won't work on the web.
Other projects can benefit from our shared libs (as we're already seeing for letter-generator).
To build a mobile app for Datenanfragen.de, we have decided to use React Native. The question now is how we want to do that, especially with regards to sharing code between the existing https://github.com/datenanfragen/website and the new mobile app.
<View>
,<Text>
, etc.).This essentially leaves us with three options:
website
in React Native. I'm quite strongly opposed to that.website
into one or more libraries but write a separate UI for React Native.I'm leaning quite strongly towards option 3. My reasoning:
website
isn't built as a pure Preact app, we have quite a bit of code in Hugo templates that we wouldn't be able to use anyway.letter-generator
).The text was updated successfully, but these errors were encountered: