Skip to content

Instantly share code, notes, and snippets.

@jeremiahblackol
Created June 28, 2020 16:26
Show Gist options
  • Save jeremiahblackol/9b391ed9443dae3da2c600dcf9aaf339 to your computer and use it in GitHub Desktop.
Save jeremiahblackol/9b391ed9443dae3da2c600dcf9aaf339 to your computer and use it in GitHub Desktop.

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

A framework is kind of like a skeleton for how an application’s code will be written. It utilizes the necessary code from libraries for me, in order to make an application work.  A framework differs from a library because it has more rules than a library and is more restrictive, I believe this is because of its complexity and its potential need to access multiple libraries.  Libraries are just collections of code snippets that do particular tasks within the code, to be reused as needed.

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

We should consider using frameworks because it is impossible to write complex, efficient and easy to maintain UIs with vanilla JavaScript. The UI needs to be in sync with the state, and there are significant chances of error, in the syncing, when using vanilla JS. It is harder to make our UI reflect our source of truth with vanilla JS.

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

Components are small collections of code that relate to a specific place in the UI. The component holds all relevant data, and functionality for that specific place in the UI. It is kind of like a building block.

* What is JSX?

JSX is HTML like syntax that creates a virtual DOM. The virtual DOM is a collection of lightweight JavaScript objects used to mimc the actual DOM.

* What are React "props?"

Props are the data that is passed from the parent component to the child component.

* What is React "state?”

State is the data of a component. 

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

It reminds me of event bubbling (kind of). An event happens at the highest level (parent component), then the information from that event (prop) is passed to a lower level (child component), something happens at the lower level like a method relative to that information (changing state), then the change created is reflected at the highest level.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment