NextJS, React, Gatsby Flashcards

1
Q

Do browsers understand JSX?

A

No - Note that browsers don’t understand JSX out of the box, so you’ll need a JavaScript compiler, such as a Babel, to transform your JSX code into regular JavaScript.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the 3 core concepts in React that you must know to build React application?

A
  • -Components
  • -Props
  • -State
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the 3 JSX rules?

A

1 - Return a single root element
2 - Close all the tags
3 - camelCase all most of the things!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the 9 things you need to consider when building modern web applications?

A

User Interface - how users will consume and interact with your application

Routing - how users navigate between different parts of your application.

Data Fetching - where your data lives and how to get it.

Rendering - when and where you render static or dynamic content.

Integrations - what third-party services you use (CMS, auth, payments, etc) and how you connect to them.

Infrastructure - where you deploy, store, and run your application code (Serverless, CDN, Edge, etc).

Performance - how to optimize your application for end-users.

Scalability - how your application adapts as your team, data, and traffic grow.

Developer Experience - your team’s experience building and maintaining your application.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a component?

A

A component is a function that returns UI elements.

const app = document.getElementById(“app”)

  function header() {
     return (<h1>Develop. Preview. Ship. 🚀</h1>)
   }

ReactDOM.render(, app)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is JSX?

A

A syntax extension for JavaScript that allows you to describe your UI in a familiar HTML-like syntax

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is NextJS?

A

A React framework that gives you building blocks to create web applications.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is React?

A

A JavaScript library for building interactive user interfaces.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the DOM?

A

The DOM is an object representation of the HTML elements. It acts as a bridge between your code and the user interface, and has a tree-like structure with parent and child relationships.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Important terms

A
  • -Component Tree

- -Nesting Components

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

In React which way does data flow?

A

Data flows down the component tree. This is referred to as one-way data flow.

State can be passed from parent to child components as props.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Here are the topics you will learn about in this comprehensive course:

Local setup
Why React?
JSX
ReactDOM.render()
Custom components
Organizing components
Reusable components
JS inside JSX
Props
Destructuring props
Rendering arrays
Mapping components
Key prop
Passing objects as props
Spreading objects as props
Props vs state
useState
useState array destructuring
Changing state
Complex state
Refactoring state
Passing state as props
Local state
Unified state
Conditional rendering
React forms
Forms input
Forms state object
Submitting forms in React
Making API calls
useEffect
Async functions inside useEffect
Local storage with React
Lazy state initialization
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is meant when it’s said that react is composable?

A

This means that code can be written in small components

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is create-react-app?

A

A tool for building SPAs with a standard structure and a good set of default options. Generated projects use the React Scripts library to build, test, and run the code. Projects have a standard Webpack configuration and a standard set of language features enabled.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

npm launches a server on port 3000 and opens a browser at the homepage. How is this page being rendered?

A

it renders a single component called , which it imports from App.js (or App.tsx) in the same directory.

The application is delivered as a single, large bundle of JavaScript. The code mounts all of its components inside this <div> in public/index.html:

<div></div>

</div>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How do I set a proxy in the package.json file?

A

“proxy”: “http://myapiserver”,

17
Q

How do I install gatsby globally on my machine?

A

npm i -g gatsby-cli

18
Q

How do I start a new gatsby project?

A

gatsby new my-app-name

19
Q

importing { Link } to enforce transparent routing between pages in your webapp accomplishes what?

A

Preloading pages inside the page so that a a full refresh of the entire page does not occur - which impacts performance

20
Q

importing { navigate } to enforce transparent programmatic routing between pages in your webapp accomplishes what?

A

i allows one to use the navigate(“/”)}> action by utilizing the navigate function

21
Q

How do I pass props to my components?

A

Like this: A Header component (header.js) note prop.title is the name we are providing

pass props inside the function as a props then reference the prop inside the component

import React from “react”

const Header = (props) => (
  <div>
    <h1>{props.title}</h1>
  </div>
)

Then inside index.js:

onst Home = () => (

<div>

...</div>