Skip to content

Instantly share code, notes, and snippets.

@MeganHuggins
Last active May 1, 2020 18:52
Show Gist options
  • Select an option

  • Save MeganHuggins/3fbc7b8a7db09905c84ca52cebf152d8 to your computer and use it in GitHub Desktop.

Select an option

Save MeganHuggins/3fbc7b8a7db09905c84ca52cebf152d8 to your computer and use it in GitHub Desktop.
### What is a "framework?" And how does it differ from a "library?"
While both a framework and a library are bound by sets of rules a framework has more and harder set rules than a library. A frameowork will most likely include predefined classes and functions that can be used to process input, manage hardware devices, and interact with system software. An additonal difference between the two is that a library, being a selection of codes that are packed together for repeated use, is called upon directly by a user whenever they want. Whereas in a framework, the framework is calling to the users code.
### Why should we consider using a framework over vanilla JS like you have been doing in mods 1 and 2?
First and foremost, using a framework helps streamline the development process as a whole. It makes it so that we, as programmers, don't need to 'reinvent the wheel' each time we build out a new application. Another huge reason for this switch is frameworks, like React, takes the pain and complication of keeping the UI in sync with the state out of the equation.
### What is a "component" in React? Why is it useful to have components?
Compenents are the building blocks of React and can be seen as essentially widgets or modules. They are collections of HTML, JavaScript and or some sort of internal data specific to that individual component. They are either defined in pure JS or JSX as they are in React.
### What are React "props?"
Props are the data which is passed to a child component from the parent compenent.
### What is React "state?"
Each React components has a built-in state object which is where you store the property values that belongs to the component. When the state object changes, React then re-renders the change compenent.
### What does "data down, actions up" mean in React?
'Data down, actions up' refers to the practice of passing data from one part of the app or code which “owns” the data down to other application layers; aka unidirectional data flow.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment