I'm learning react recently. I don't understand why any online tutorial said that react has View Layer only. But I think react has Controller Layer only.
Can any one help me understanding how react has View Layer?
If we think about a web app that utilizes React as utilizing a Model View Controller architecture then your tutorial makes sense. React acts as your view, but interfaces with your server. Your server acts as your controller, but interfaces with your database. Your database acts as your model.
A React application can be written completely in JavaScript files. In this case you would utilize JSX for your template structure and JSS for your styles.
React also gives you the ability to manipulate your DOM using JavaScript. It simplifies this by giving you lifecycle methods to work with, or hooks. Behind the scenes React uses a virtual DOM and a process called reconciliation to make updates to only the components that require changes based on the JavaScript logic you implement. This makes React applications very efficient, and gives you a tremendous amount of control over your UI.
This is a very broad answer, but I think you need to spend some more time looking through the docs and watching more tutorials to understand the framework and how it fits into a web app's stack. Hopefully this helps point you in the right direction. It's a fantastic framework, so stick with it!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With