Can I create a website + native app that uses the same frontend code?
I hear a lot about react native and sharing codebase or something but I never understand the phrasing
Is it possible to have a website + app that use the same frontend code or do I always need 2 separate, because last time I tried react-native I saw that it doesnt use CSS and HTML , and I can't worry about responsiveness on screens that arent mobile
3 Replies
you have the same core concepts as the react and react native
such as state, lifecycle and more
the primitives such as <Input/> or <Textfield/> may differ
but the underlying idea should work the same way
you can check tools like tamagui (https://tamagui.dev) on how they are able to share direct code between native+web
Tamagui
Tamagui — React Native + Web UI kit
Write less, run faster. Styles, optimizing compiler & UI kit that unify React Native + Web.
also code sharing wise, you can have stuff like fetch being the same for both of them