This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://www.youtube.com/watch?v=sYDFCuZHrqw&list=PL-F_CAUJfW9Xbg5l4PGknlRqur9oT_8Go&index=2 | |
// DaveCeddia Hook useReducer example | |
import React, { useReducer } from "react"; | |
import ReactDOM from "react-dom/client"; | |
import "./index.css"; | |
const inlineStyle = { | |
display: "flex", | |
flexDirection: "column", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Dave Ceddia Hook useState example | |
// https://www.youtube.com/watch?v=Y8GdPk88Ejg | |
import React, { useState } from "react"; | |
import ReactDOM from "react-dom/client"; | |
const RevealText = ({ text, maxLength }) => { | |
const [hidden, setHidden] = useState(true); | |
if (text.length <= maxLength) { | |
return <span>{text}</span>; |