UNPKG

set-state-compare

Version:

setState for React that compares with the current state and only sets the state if changed.

9 lines (6 loc) 309 B
import memoCompareProps, {memoComparePropsWithDebug} from "./memo-compare-props.js" import React from "react" const memo = (component) => React.memo(component, memoCompareProps) const memoWithDebug = (component) => React.memo(component, memoComparePropsWithDebug) export {memoWithDebug} export default memo