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://anh.pw/do-not-use-usestate-directly-when-working-with-nested-object | |
Note: | |
- v1.2: support update, toggle and delete | |
- v1.0: support update and toggle | |
*/ | |
import { get, set, cloneDeep } from "lodash" | |
import { useDeepCompareEffect } from "react-use" |
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
<picture> | |
<source | |
srcSet={`${mockupDesktop} 1x, ${mockupDesktop2x} 2x, ${mockupDesktop3x} 3x, ${mockupDesktop4x} 4x`} | |
media="(min-width: 768px)" | |
/> | |
<source | |
srcSet={`${mockupMobile} 1x, ${mockupMobile2x} 2x, ${mockupMobile3x} 3x, ${mockupMobile4x} 4x`} | |
media="(max-width: 767px)" | |
/> | |
<img |