Skip to content

Instantly share code, notes, and snippets.

@sneljo1
Created November 2, 2018 10:15
Show Gist options
  • Save sneljo1/6653477989372077f3abeddc51b1f11c to your computer and use it in GitHub Desktop.
Save sneljo1/6653477989372077f3abeddc51b1f11c to your computer and use it in GitHub Desktop.
Extend react types to support React.memo
import { StatelessComponent, SFCElement } from "react";
declare module "react" {
function memo<P>(
type: StatelessComponent<P>,
compare?: (oldProps: P, newProps: P) => boolean
): SFC<P>;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment