lundi 26 octobre 2020

What are the best design Patterns for React Native apps

I am new to React Native and only recently picked it up, I am using it to make an app for my final year university project, learning the framework as I go using different examples from online.

So far I have been using function components with everything for one component in the same class, eg. view, functions and styles. - So far this has been working and seems to preform efficiently.

My question is aimed at any experienced React Native developers. - Is my current approach of function components a good coding practice for React Native apps or should I be using class components. From my little experience it seems function components are easier and I have done some research that shows function components are becoming more common with hooks etc. - I'm just not sure if its the best approach for a full application.

Another question I have is aimed at design patterns. - Should functionality, view and styles all be in the same class or would it be better practice to split them out and just import as appropriate - similar to Angular. The reason i ask this is because all examples that I have seen/followed up to now take the approach of everything in the same class but that may just be for presentation purposes.

Aucun commentaire:

Enregistrer un commentaire