Skip to content

Instantly share code, notes, and snippets.

View tunapotur's full-sized avatar

Ahmet Tuna POTUR tunapotur

View GitHub Profile
@tunapotur
tunapotur / DaveCeddia_Hook_useReducer.js
Last active September 23, 2022 09:51
DaveCeddia Hook useReducer example
// 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",
@tunapotur
tunapotur / DaveCeddia_Hook_useState.js
Last active September 22, 2022 19:04
Dave Ceddia Hook useState
// 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>;