React Class or function

Posted on

What is React ?

React is one of the popular framework in a market. Currently this framework whitch was created and develop by Facebook company compete anothers framework such as Vue or Angular. Of course exist many tools and frameworks whitch are used to build web products but still react is one of the most likely framework. The fenoment of this js framework I supposed is simplicity and building reusable code. Additionall benefit of this framework is ability to build and maintain state of the application without using redux whitch is quite have framework. State could be created and maintained in a single component but using communication betwean components we can extend state to more then one component. 

Function component

React functionall components are quite simple and from the React are similar to the class components. React function return as output some JSX code. This is very importand because we can build DOM tree using functionall components in functionall components. This is very usefull because we can create DOM tree using the same functionall components many times. This solution reduce ours code and help to build more extendible product. 

#TODO: Add example of code

If we are using functionall components we can use parameter props (properties) whitch can help in communication betwean components. Additionall solution where we don’t want to use props.<parameter_name> we can use just a name of the variables witch we send to the component function somename({param1, param2})

#TODO: Add exampel of code

Leave a Reply

Your email address will not be published. Required fields are marked *