Spring 2023
Slides credited to Joel Ross
For the Final Draft of the project, we're looking for it to be totally complete! See the Canvas page for full details.
Final Projects will be graded in two parts:
Firebase is a web backend solution; it provides multiple features which you can access without need to "code" them yourselves.
An effect hook is used to specify "side effects" of Component rendering -- code you want to execute only once and not on each render!
//import the hooks used
import React, { useState, useEffect } from 'react';
function MyComponent(props) {
const [stateData, setStateData] = useState([]);
//specify the effect hook function
useEffect(() => {
//code to do only once here!
//asynchronous methods (like fetch), etc
fetch(dataUri) //e.g., send AJAX request
//...
setStateData(data); //okay to call state setters here
}, []) //array is the second arg to the `useEffect()` function
//It lists which variables will "rerun" the hook if they
//change
//...
}
A library (provided by Firebase) that created a sign-in form for your page.
The React bindings for FirebaseUI (firebaseui-web-react) has not been updated for React 18 yet, and may have been abandoned. See the open pull request from Gabriel Villenave.
//in package.json
"react-firebaseui": "https://gitpkg.now.sh/gvillenave/firebaseui-web-react/dist"
# Install library (on command line)
npm install https://gitpkg.now.sh/gvillenave/firebaseui-web-react/distA second option is to instead install the firebaseui library (instead of the React bindings) and copy in the StyledFirebaseAuth.tsx file yourself.
Until the pull request is accepted, one work around is to install the updated fork instead of the usual package:
Review Everything
Problem Set 09 due next Wednesday
Late/missing Problem Sets02-09 due on Friday
Final Project due on next^2 Monday (Jun 5)!
This is a HARD deadline. No extension!
We need to grade all projects
Next time (next Wed): The Era of AIGC + Conclusion