View finished result here / Fork this Codepen to get started
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, { Component } from "react"; | |
import ReactDOM from "react-dom"; | |
import { Flipper, Flipped } from "react-flip-toolkit"; | |
import "./styles.css"; | |
const listData = [0, 1, 2, 3, 4, 5, 6, 7]; | |
const colors = ["#6da5ff", "#7971ea", "#5900d8"]; | |
// we'll iterate over this array to create groups of 3 components | |
const baseArray = [...Array(3).keys()]; |
Use a password manager and use different, complex passwords for every site. (The password manager will make it easy to generate and save new, secure passwords.) The one I use is OnePassword (paid plan).
Create a coverage report to see which code was downloaded, and which code was actually used for a given entry point of your app.
Download the report and put it in the top level directory of your project. Make sure it's named coverage.json
.
Create this file in the top level directory of your project:
build-bundles.js
This file has been truncated, but you can view the full file.
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
[ | |
{ | |
"url": "https://www.reddit.com/", | |
"ranges": [ | |
{ "start": 0, "end": 99 }, | |
{ "start": 447, "end": 629 }, | |
{ "start": 655, "end": 1210 }, | |
{ "start": 1221, "end": 1494 }, | |
{ "start": 1505, "end": 1507 } | |
], |
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 { useRef } from "react"; | |
import cloneDeep from "lodash.clonedeep"; | |
import isEqual from "lodash.isequal"; | |
const useDeepEqualCallback = (callback: any, deps: any[]) => { | |
const callbackRef = useRef(callback); | |
const cachedDeps = useRef(cloneDeep(deps)); | |
if (!isEqual(deps, cachedDeps.current)) { | |
callbackRef.current = callback; | |
cachedDeps.current = cloneDeep(deps); |
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
export type FetchConfig = RequestInit & { | |
postman?: boolean; | |
method?: keyof typeof HTTPMethods; | |
body?: any; | |
root: string; | |
path?: string; | |
params?: Record<string, any>; | |
}; | |
export interface Global { |
OlderNewer