I hereby claim:
- I am d-maher on github.
- I am d_maher (https://keybase.io/d_maher) on keybase.
- I have a public key ASBi4YxoKDmPrlfcm4OMxCdNlis7JjdUa-dxqRwAAmMfHwo
To claim this, I am signing this object:
import { useState } from "react"; | |
function useCounter( | |
initialCount: number = 0 | |
): [number, () => void, () => void] { | |
const [count, setCount] = useState<number>(initialCount); | |
function increment() { | |
setCount(count + 1); | |
} |
import React from "react"; | |
import useCounter from "../hooks/useCounter"; | |
function CounterWithHook() { | |
const [count, increment, decrement] = useCounter(); | |
return ( | |
<div> | |
<p>Count: {count}</p> | |
<button onClick={increment}>Increment</button> |
import React, { useState } from "react"; | |
function Counter() { | |
const [count, setCount] = useState(0); | |
const increment = () => { | |
setCount(count + 1); | |
}; | |
const decrement = () => { |
import React from "react"; | |
function UserGreeting({ name, age }) { | |
return ( | |
<p> | |
Hello, my name is {name} and I am {age} years old. | |
</p> | |
); | |
} |
import React from "react"; | |
function HelloWorld() { | |
return <h1>Hello, World!</h1>; | |
} | |
export default HelloWorld; |
I hereby claim:
To claim this, I am signing this object:
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |