Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am lende on github.
  • I am lende (https://keybase.io/lende) on keybase.
  • I have a public key ASCEmozRWyULDZABDiC1sQQBWk2cZno4cXhuKVQCZr1Fsgo

To claim this, I am signing this object:

@lende
lende / semi-controlled-input.jsx
Last active September 12, 2016 13:07
An input-component for React that only updates its value when unfocused
import React from 'react';
import ReactDOM from 'react-dom';
class Input extends React.Component {
shouldComponentUpdate() {
// Do not update component (value) when focused (user is typing)
return document.activeElement !== this._self;
}
render() {
return (