Skip to content

Instantly share code, notes, and snippets.

@camaragon
Last active January 29, 2021 20:51
Show Gist options
  • Save camaragon/fb021eae6e988a0e974d2fb838b1ef50 to your computer and use it in GitHub Desktop.
Save camaragon/fb021eae6e988a0e974d2fb838b1ef50 to your computer and use it in GitHub Desktop.
Mod 3 Pre-Work

Mod 3 Pre-Work

Instructional Deliverables

  • What is a "data model", and how does it relate to the DOM in a front-end application?

A data model explicitly determines the structure of the data of a program. It holds all of the raw data manipulation and is the one source of truth. The data model should be completely seperate from the DOM in a front-end application, but the manipluted data can then be used to update the DOM. No DOM changes should be affecting the data model in anyway.

  • What is a "framework?" And how does it differ from a "library?"

A framework is a collection of JavaScript code libraries that give developers access to pre-written code to use for routine programming features and tasks. A framework consists of rules and restrictions that tells the developer what they need, while a library doesn't. A developer will need to make a call to the library when they need it, but with a framework it will make a call to the code that can further take it to a library.

  • Why should we consider using a framework over vanilla JS like you have been doing in mods 1 and 2?

Of my understanding the best reason for frameworks is because they do a very good job of keeping the UI in sync with the current state. There are also some other pro's such as writing much less code and shortcuts built into the framework. This will give us experience as well, as many development jobs use frameworks.

  • What is a "component" in React? Why is it useful to have components?

A component in React is a JavaScript class or function that can take in parameters and returns React elements that determines how the UI should appear. They are called the building blocks of any React app and they allow for the interaction of other components and the DOM updates.

  • What is JSX?

JSX (JavaScript XML) is a language mixing JavaScript and HTML to make it easier to write and add HTML in React.

  • What are React "props?"

React props stand for properties and is used for passing data from one component to another within a React app. Props can also be used like function arguments in JavaScript and attributes in HTML.

  • What is React "state?"

React components have a built-in state object. The state object is where one stores the property values that belongs to the component. Wehen the state object is altered, the component re-renders therefore updating the DOM.

  • What does "data down, actions up" mean in React?

Data down, actions up is a phrase that describes the flow of information from the parent to child components and vice versa. Data down represents the passing of data such as props from parent to child components. The actions up represents sending those messages back up the hiearchy to notify the parent components that a certain action has taken place.

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