Skip to content

Instantly share code, notes, and snippets.

View AndriyHromyak's full-sized avatar

Andriy AndriyHromyak

View GitHub Profile
@Eightyplus
Eightyplus / InputAutoComplete.jsx
Created June 15, 2018 08:08
React auto-complete input
import React, { Component } from 'react';
export default class InputAutoComplete extends Component {
constructor (props) {
super(props);
this.options = ['britain', 'ireland', 'norway', 'sweden', 'denmark', 'germany', 'holland', 'belgium', 'france', 'spain', 'portugal', 'italy', 'switzerland'];
this.state = {
input: '',
selected: false
@sorenlouv
sorenlouv / determine-changed-props.js
Last active April 18, 2024 16:21
Determine which props causes React components to re-render
import React, { Component } from 'react';
export default function withPropsChecker(WrappedComponent) {
return class PropsChecker extends Component {
componentWillReceiveProps(nextProps) {
Object.keys(nextProps)
.filter(key => {
return nextProps[key] !== this.props[key];
})
.map(key => {
@iamakulov
iamakulov / index.md
Last active October 8, 2023 20:15
Imports and webpack contexts
@singhshivam
singhshivam / Immutable JS Examples
Last active August 5, 2023 19:16
Immutable JS Examples
List()
var list = Immutable.List([1,2,3])
// [1, 2, 3]
List.isList()
Immutable.List.isList(list)
// true
List.of()
var list = Immutable.List.of(1,2,3);