import { Head, Appear } from "mdx-deck"; import Logo from "./assets/images/logos/rdc-icon.svg"; export { default as theme } from "./theme";
Remember to sit with your lab group!
Talk to your neighbors and tell them a little bit about why you decided to take this course.
What is React, to the best of your knowledge?
React is a JavaScript library for creating user interfaces.
Facebook's official website tells us that React is a library for building user interfaces.
What that means is that we can use React to build a website's "view."
React is also a mental model for writing components. That means React is not just for websites!
- JavaScript Mechanics
- Functional React
- Stateful React
- React Ecosystem
- HTML and CSS (you've done this!)
- JavaScript
Every website you've ever visited has sent your browser (Google Chrome/Firefox/etc.)
a bundle of HTML, CSS, and JavaScript.
HTML and CSS are not considered "programming languages" proper.
HTML is a _markup language_, or a way of describing a hierarchical structure
of information. You can use HTML to tell the browser what the actual content of
your page is.
CSS is a standard way of specifying declarations to change the appearance of
those HTML elements. You can use CSS to tell the browser how something should
appear on a page.
JavaScript is the programming language of the Web. All modern browsers are expected
to understand and interpret JavaScript in much the same way, and we can use
JavaScript to perform programming tasks. This is also how we can define dynamic
behavior on your website.
Most of this course will focus on the use of JavaScript.
function sayHello(name) {
return "Hello, " + name + "!";
}
// First, let's find some element
let paragraph = document.querySelector("p");
// Next, we can read and modify the element's properties
console.log(paragraph.innerText);
paragraph.innerText = "Hello, world!";
// Any property we can set on HTML: we can set with JS
paragraph.style.color = "red";
// We can also create elements with JS!
let newParagraph = document.createElement("p");
newParagraph.innerText = "Hello world, part 2";
document.body.appendChild(newParagraph);
- You get to practice JS and debugging (_HW 1 to be released soon_)
- We'll continue diving into more properties of the DOM
- ...and then we'll talk about React