- Add to home screen
- Install banner
- Offline support
- App shell
- Push notifications?
- Background sync?
- Server side rendering (SEO + improve First Meaningful Paint(FMP))
This file contains hidden or 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 COLORS = { | |
| blue: ['#1E88E5', '#90CAF9'], | |
| brown: ['#6D4C41', '#D7CCC8'], | |
| gray: ['#212121', '#BDBDBD'], | |
| green: ['#388E3C', '#A5D6A7'], | |
| red: ['#E53935', '#EF9A9A'], | |
| orange: ['#F4511E', '#FFAB91'], | |
| purple: ['#8E24AA', '#E1BEE7'], | |
| yellow: ['#FFD600', '#FFF59D'], | |
| } |
This file contains hidden or 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
| var el = document.createElement('script'); | |
| el.src = "https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.10/lodash.core.min.js"; | |
| el.type = "text/javascript"; | |
| document.head.appendChild(el) |
In fact, React.cloneElement is not strictly associated with this.props.children. It's useful whenever you need to clone react elements(PropTypes.elements) to add/override props(such as attaching event handlers or assigning key/ref attributes) as react elements are immutable.
React.cloneElement( element, [props], [...children] ) is almost equivalent to: <element.type {...element.props} {...props}>{children}</element.type>
However, children prop in react, is specially used for containment(aka composition) of other components, e.g,
This file contains hidden or 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
| //////////// https://twitter.com/sophiebits/status/1058448900460138497 | |
| // alternative use `console.group`, `console.groupEnd`, pen: https://codepen.io/zzzzBov/pen/yQLyyG/ | |
| function log(format, ...args) { | |
| let indent = ' '.repeat(new Error().stack.match(/\n/g).length - 2); | |
| if (typeof format === 'string') { | |
| console.log(indent + format, ...args); | |
| } else { | |
| console.log(indent, format, ...args); | |
| } |
This file contains hidden or 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
| { | |
| "window:devtools": "command+alt+i", | |
| "window:reload": "command+r", | |
| "window:reloadFull": "command+shift+r", | |
| "window:preferences": "command+,", | |
| "zoom:reset": "command+0", | |
| "zoom:in": "command+plus", | |
| "zoom:out": "command+-", | |
| "window:new": "command+n", | |
| "window:minimize": "command+m", |
axios.get('/user/12345')
.catch(function (error) {
if (error.response) {
// The request was made and the server responded with a status code
// that falls out of the range of 2xx
console.log(error.response.data);
console.log(error.response.status);
console.log(error.response.headers);
} else if (error.request) {