Skip to content

Instantly share code, notes, and snippets.

@amykarnaze
Last active August 14, 2020 22:50
Show Gist options
  • Save amykarnaze/2b8395ec10d5ce8beda1d8a7f2f39ff1 to your computer and use it in GitHub Desktop.
Save amykarnaze/2b8395ec10d5ce8beda1d8a7f2f39ff1 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 code that is being run behind the scenes and the source of truth. It is stored information. It is not what updates the display of that information, which is the DOM. Document Object model is a programming interface that is hooked up to the data model and what you see on a webpage.

What is a "framework?" And how does it differ from a "library?" Frameworks and libraries are pre written code. Frameworks like react enable the ui to be updated with the changing data and have more structure than a library, which can be used at any time by the developer. Frameworks make calls to your code.

Why should we consider using a framework over vanilla JS like you have been doing in mods 1 and 2? A framework enables the ever changing data to always be displayed with the current information. Not using a framework is inefficient, lots of repetitive code that is susceptible to bugs. Frameworks allow for small isolated changes.

What is a "component" in React? Why is it useful to have components? Compnents are the building blocks of react. Parent componets or componets contain their own data. The parent/child relationship encapsulates the data, so we can only manipulate that data of those components. All components have render methods, renders component to DOM node, UI interface.

What is JSX? HTML like syntax that is like a JS object to form a JS representation of the actual DOM.

What are React "props?" The data thaat is passed from the parent to its child components. Like properties. The state can be hand

What is React "state?" The internal data store (object) of a component. You set the state of a components in the constructor. this.state = {}. To modify a components state, setState method is used for any data changes and re-renders the dom with only those changes.

What does "data down, actions up" mean in React? The parent component is the the main player of react. It passes data down to child components via props. The child lets the parent know when then the data has changed, actions up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment