Skip to content

Ruila/compare-props

Repository files navigation

🚀
compare-props



npm i compare-props
Or
yarn add compare-props



Checking if props change with React.memo in React components.

Test Data: link

Usage

import React from "react"
import { compareProps } from "compare-props"

type DemoProps = {
  name: string,
}

export const Demo: React.FunctionComponent<DemoProps> = React.memo(
  ({ name }: DemoProps) => {
    return <div>Title: {name}</div>
  },
  compareProps
)