Skip to content

Instantly share code, notes, and snippets.

@oliviacweb
Created May 1, 2020 23:04
Show Gist options
  • Save oliviacweb/644fa99ba3f86c3b25e87ff98ebbe166 to your computer and use it in GitHub Desktop.
Save oliviacweb/644fa99ba3f86c3b25e87ff98ebbe166 to your computer and use it in GitHub Desktop.
## What is a "framework?" And how does it differ from a "library?"
difference lies in "inversion of control".
The technical difference between a framework and library lies in a term called inversion of control.
With a library you choose when and where to call it and implement the code. With a framework it provides places for you to
plus in code but it is in charge of the "flow".
You call a libraries code, a framework calls your code.
## Why should we consider using a framework over vanilla JS like you have been doing in mods 1 and 2?
They are more efficient. They provide a blueprint to work off of instead of having to build out an entire foundation.
they help async functionality and data retrieval be easier and have fewer bugs.
Better performance at scale.
## What is a "component" in React? Why is it useful to have components?
Components are building blocks. They are pieces of reusable code like classes or functions in vanilla JS. in fact there are
2 types of components: class components and function components. Let's you break up UI into seperate manageable, reusable pieces.
## What are React "props?"
props are properties that pass from parent to child component. they can only pass from parent to child.
## What is React "state?"
state is a built in object on a component. it stores data that can change sometimes based on user interaction. when the state object
changes the component rerenders. But it can also save the former state of the component.
## What does "data down, actions up" mean in React?
This is about the flow of information in REACT. meaning data flows down from parent to child, while events or actions flow up from child to parent.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment