List of helpful shortcuts for faster coding
If you have any other helpful shortcuts, feel free to add in the comments of this gist :)
| import React, {useState, useEffect, useRef} from 'react' | |
| import classNames from 'classnames' | |
| import {useIntersection} from 'use-intersection' | |
| const Video = ({ | |
| video, | |
| poster, | |
| posterWidth = 1920, | |
| posterFitMode = 'preserve', |
| /** | |
| * | |
| * @param {HTMLElement} [target=document.body] - Element to querySelect in | |
| * @param {boolean} [namespaced] - Only get children with data-ref-parent-ref | |
| * @param {string} [exclude] - Selector or element who's children wont be selected | |
| * @param {boolean | function} [watch] - Watches DOM and updates refs on mutation | |
| * @param {boolean} [asArray] - Saves all refs in arrays, also single elements | |
| * @returns {Object} { myRef: div, another: [button, span] } | |
| */ | |
| export default ({ |