Skip to content

Instantly share code, notes, and snippets.

@gadzhimari
gadzhimari / what-forces-layout.md
Created May 14, 2019 10:29 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
@gadzhimari
gadzhimari / link.js
Created July 17, 2019 06:27
Link parser for chat messaging app
@gadzhimari
gadzhimari / useGeolocation.js
Created November 9, 2021 07:02
Geoposition hook
import { useReducer } from 'react';
import { useEffectOnce } from 'react-use';
import { GeolocationPositionError } from 'errors';
const geoPositionReducer = (state, action) => {
switch (action.type) {
case 'error': {
return {
...state,
status: 'error',

Conventional Commit Messages

See how a minor change to your commit message style can make a difference. Examples

Have a look at CLI util git-conventional-commits to ensure this conventions and generate changelogs

Commit Formats

Default