Web Development / React Fundamentals

Ace your homework & exams now with Quizwiz!

What is a document object model (DOM)?

A DOM is model (usually portrayed as a tree view) of the web page's source. The DOM is an object-oriented representation of the web page, which can be modified with a scripting language such as JavaScript without having to hardcode change the HTML.

How do you define a component in React?

A component can be defined using a method/function or a class. At the end of the day, a component is something that just returns some JSX. This is why in both implementations you will see a return of JSX. To create a component using a class you do " class className extends Component{} " .

What is a component in React.js?

A component is one isolated piece of interface. A React web page is made up of different components. On a blog website, there may be sidebar component consisting of an 'About' and 'Links' component or a blog component consisting of a 'Blog Post' component. Long story short, everything in React is a component. A React app is built on this idea of putting components together.

What is a state in React.js?

A state is the properties of a component. When the state changes the React knows to rerender the component, thus allowing for dynamic web pages without complete page refreshes or redirection.

What is a virtual DOM in React?

A virtual DOM is an abstraction of a DOM. It is a programming concept where an ideal, or "virtual", representation of a UI is kept in memory and synced with the "real" DOM by a library such as ReactDOM. This process is called reconciliation. When the state of a component changes, React updates the virtual DOM tree. Once the virtual DOM has been updated, React then compares the current version of the virtual DOM with the previous version of the virtual DOM. Once React knows which virtual DOM objects have changed, then React updates only those objects, in the real DOM. This makes the performance far better when compared to manipulating the real DOM directly. This makes React stand out as a high-performance JavaScript library.

What are web services and what are they used for?

A web service generally refers to a web page, that can be called from an application (be it another web page, or desktop app), and the caller will pass in data to it, or receive data from it. In this sense, it's basically like a 'method' or 'function' in a normal programming language; except you're calling it over the internet and data is being passed from someplace else other than your local machine.

What is JSX in React?

JSX in simple terms is React's "custom" HTML. It is how React gets away with declaring JavaScript in what looks like HTML code or vice versa.

What is a MVC (Model View Controller) and where is React in this architecture?

MVC is a software architecture that can be broken into 3 components, the model, the view, and the controller. View - The front end of the system. Displays visualization of the data to the user, it is only connected to the controller. Model - The data, represents the data, and does nothing else. The model does NOT depend on the controller or the view. Controller - provides model data to the view, and interprets user actions such as button clicks. The controller depends on the view and the model. React.js would be the 'V' in MVC since React.js is only used for the front-end logic.

What are props in React?

Props or "properties" are like function parameters in JavaScript and attributes in HTML combined. They are something you pass through what looks like an HTML attribute into a JavaScript argument. (Go to Google doc)

How do you implement a state in React.js?

States can be implemented using functions/methods or added to classes. It is a newer way to utilize the implementation of states using functions/methods through something called React Hooks - Just know that a Hook makes it easier to implement states. (Go to google doc)


Related study sets

Personality psych ch.12 the humanistic approach relevant research

View Set

Principles of Finance Exam 1 - UARK (Kefu Wu)

View Set

Piper School: Abraham Lincoln and the Civil War

View Set

CISCO Chapter 6 Exam Flash Cards

View Set

Drive Right Chapter 9 Study Guide

View Set

Ch 43: Antiulcer Drugs (Elsevier)

View Set

Chapter 1 - Managing and the Manager’s Job

View Set

Which number is bigger? Three Digits

View Set