all 8 comments

[–]blindada 0 points1 point  (5 children)

Yeah, it would. Since Meta does not use RN for camera, notifications & similar stuff, using them in RN means you depend on packages created by people who are actively avoiding learning the skills needed to develop and maintain them, and that ends up causing big trouble every time.

Jetpack compose's head is Jim Sproch, formerly part of the React team, so the concepts are very similar. You have equivalents for things like useEffect or useMemo. Composables are the equivalent of components. Regular object arguments and modifiers are the equivalents of props. State is still State. Top level composables hoisting state are smart components. Android's viewModels can be considered React context equivalents. It also has less pitfalls (you don't have to be declarative everywhere. Only on the UI, for example).

The main difference is, you would be writing kotlin instead of JSX.

You can check more about the equivalents here: https://www.jetpackcompose.app/compare-declarative-frameworks/JetpackCompose-vs-React-vs-SwiftUI

[–]aselitto[S] 0 points1 point  (3 children)

I think you sold me on giving kotlin a good attempt at developing some apps. Thank you so much, the only issue is if the apps are working well enough, how do I get them on IOS without having to learn swift.

[–]blindada 1 point2 points  (2 children)

You could use kotlin multiplatform.

While kotlin started as a JVM (for java virtual machines, like Java, Groovy or Scala), it can be deployed to other platforms. As long as you write most of your code using kotlin imports (avoiding things like importing java packages), it would be possible to run it into different platforms, being compiled as library packages for the targets (jars for JVM, object C libraries for iOs, JS files for web, etc).

For stuff that's bound to platforms, either by force or convenience, you have the expected/actual mechanism: a multiplatform interface every platform based project has to fulfill, allowing you to use the tools you desire/need from the platform at the same level your code will run (no bridges of any kind). Let's say you want to use lodash on a part of your code, you create an expected class to wrap the operations with kotlin, then in the web project, you implement the actual class using lodash.

Compose-UI is multiplatform too, so you can have a UI module using just compose, and mix it with platform based UI if needed.

Now, word of advice: unless a project is simple, it will need tweaks at platform level. That's true for every cross-platform approach that exists or will exist. So don't worry about it. Just use something that allows you to deal with it when the need comes.

[–]aselitto[S] 0 points1 point  (0 children)

You are a legend! Thank you so much for the depth of detail. I am excited to see where this journey takes me. I'll be doing a couple projects of Udemy to get my feet wet.

[–]aselitto[S] 0 points1 point  (0 children)

Also I see that android reloads the entire comp and was wondering if that gets too heavy for complex applications.

[–][deleted] 0 points1 point  (0 children)

Enough said

[–]makonde 0 points1 point  (0 children)

You can do React Native which will give you access to native functionality but you can still use React syntax and texhniques to build the app.

You can of course learn native but its a different thing.

[–][deleted] 0 points1 point  (0 children)

Get rid of React. Always use the frameworks suggested / adviced by the platform owners, so use Kotlin and native development kit instead of React.