- Each person in your group should take one of the following topics and explain it to the group in their own words. Be sure to provide concrete examples in your explanations. For the remaining topics, discuss them as a whole group.
- Node Package Manager
- Imperative vs Declarative
- Components
- JSX
- Imports and Exports
- Props
- When would you use props in react?
- Assuming UserDetail is a component, what will it's props be if it's rendered as follows:
const user = {name: 'Spider Man', age: 32}
<UserDetail title="Profile Page" dog="Fido" user={user} />
NPM: it is an online repository for the publishing of open-source Node.js projects. we can avoid coding the same thing which is already written by another developer, just by installing npm and applying it to the project.
Imperative vs Declarative: Imperative programming is like giving instructions step-by-step on
how to operate a certain function. Declarative programming is like using a function without being concerned about the steps.
Components: they are the block elements of a webpage. they are re-usable. for example navbar, footer, sections etc. these components do no effect each other.
JSX: JavaScript XML. It allows us to put HTML into JS. It is an extension of React. Example: const element =
Hello World
Imports and Exports: This is the way to communicate with the components. You can export component that you want to use in another place. and in that place you can import what you want to use.
Props: We use props in React to pass data from one component to another (from a parent component to a child component(s)). Props is just a shorter way of saying properties.
they are objects that we assign to functions in react as an input. later on we can use these props in the function itself to define what will be shown on the screen. example:
function Welcome(props) {
return
Hello, {props.name}
;2- They are useful when you want the flow of data in your app to be dynamic.
3- name and age