Skip to content

Instantly share code, notes, and snippets.

Working from home

Adam Gajzlerowicz adamgajzlerowicz

Working from home
  • Poznań
Block or report user

Report or block adamgajzlerowicz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:32a3a10599623ec8987a902a3928d3d4
import { PureComponent } from 'react';
PureComponent.componentDidUpdate = prevProps => {
const name =
this.constructor.displayName || || 'Component';;
Object.keys(prevProps).forEach(key => {
if (prevProps[key] !== this.props[key]) {
`property ${key} changed from ${prevProps[key]} to ${
View jest mock component to string
jest.mock('../../../../components/ComponentFoo', () => 'foo')
View gist:3c69dd1df55d7b8c0cba9e9b8ffe552b
import React from 'react'
const withClickOutside = Component => {
class Wrapped extends React.Component {
constructor(props) {
this.setWrapperRef = this.setWrapperRef.bind(this)
this.handleClickOutside = this.handleClickOutside.bind(this)
You can’t perform that action at this time.