Skip to content

Instantly share code, notes, and snippets.

// Reusable fetching hook
const useRequest = (requestFunc) => {
const [data, setData] = useState({})
const [loading, setLoading] = useState(false)
const [error, setError] = useState(null)
const fetch = async () => {
setLoading(true)
try {
const data = await requestFunc()
@jpnelson
jpnelson / split.css
Last active June 14, 2022 16:51
Responsive, resizable panel layout with flexbox
.container {
height: 500px;
border: 2px solid grey;
position:relative;
}
.split {
display: flex;
height: 100%;
border: 1px solid black;