This file contains 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
import React, { useState, useEffect } from "react"; | |
import "./styles.css"; | |
function CheckUsername({ url }) { | |
const [result, setResult] = useState(""); | |
const [data, setData] = useState(""); | |
const handleErrors = response => { | |
console.log(response); | |
if (!response.ok) throw Error(response.status); |
This file contains 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
const AppContext = React.createContext(defaultValue); |
This file contains 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
'10000'.replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1,'); | |
// 10,000 |
This file contains 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
import React, { useState, useEffect } from 'react'; | |
const InfiniteScrollList = () => { | |
const [items, setItems] = useState([]); | |
useEffect(() => { | |
const loadMore = () => { | |
// fetch relavant data and update state | |
} |