Skip to content

Instantly share code, notes, and snippets.

@relyt4me
Created August 14, 2020 19:26
Show Gist options
  • Save relyt4me/dc381db40375b409e6eec4571b146673 to your computer and use it in GitHub Desktop.
Save relyt4me/dc381db40375b409e6eec4571b146673 to your computer and use it in GitHub Desktop.
* What is a "data model", and how does it relate to the DOM in a front-end application?
The data model is the logic side to the code. This means that it is where the data is manipulated. It is seperate from the DOM in that the DOM is the structure the the UI is built from. By keeping these things seperate the code becomes easier to read and more testable.
* What is a "framework?" And how does it differ from a "library?"
A framework is a tool used to interact between the UI and the data state. A library is similar but the tools must be managed directly. Frameworks tend to have more rules than Libraries and call to your code.
* Why should we consider using a framework over vanilla JS like you have been doing in mods 1 and 2?
Frameworks help to make the code more readable in that there are less lines needed to manipulate the UI. It also is easier to maintain when changes are needed.
* What is a "component" in React? Why is it useful to have components?
Components are a combination of CSS Javascript and HTLM put together to make the building blocks of React. They act like encolsed functioning widgets and because of this are great tools for easy manipulation in the UI. They can sit inside eachother and use properties of their parents much like the use of parent classes in Javascripts.
* What is JSX?
JSX are expressions that can be used like declared variables in tandem with React creating React Components or Elements.
* What are React "props?"
Props are the arguments of React components and work in that fashion.
* What is React "state?"
The state is the data of the react components and each component has its own state which can be managed with React. This data is also passed or can be passed from component parents to children.
* What does "data down, actions up" mean in React?
This refers to how code should be written so that child components recieve data from parents and enact on that data passing responsed up to the parent.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment