I am pretty new to react/react-native and want to develope my first app. During programming I saw that there are two diffrent ways to declare a component. As I understood I always have to use class-components, if I want to access state variables. But according to the react documentations it is also possible to access state variables via useState inside functional-components and now I do not rly know what to use as best practice.
Is there some sort of rule set or coding patterns on when to use class- and when functional-components?
Thank you very much in advance!
question from:
https://stackoverflow.com/questions/65832589/react-native-when-to-use-class-or-functional-components 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…