Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why react has View Layer only?

Tags:

reactjs

view

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?

like image 733
Mohamad Shiralizadeh Avatar asked Dec 08 '25 10:12

Mohamad Shiralizadeh


1 Answers

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!

like image 157
Don Brody Avatar answered Dec 10 '25 01:12

Don Brody



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!