{"id":18982279,"url":"https://github.com/profusion/with-props-change-logger","last_synced_at":"2026-07-02T14:03:56.002Z","repository":{"id":40253899,"uuid":"474207806","full_name":"profusion/with-props-change-logger","owner":"profusion","description":"Log Changed Properties in a React Component","archived":false,"fork":false,"pushed_at":"2023-05-12T20:39:23.000Z","size":1077,"stargazers_count":2,"open_issues_count":7,"forks_count":0,"subscribers_count":22,"default_branch":"main","last_synced_at":"2025-01-01T11:42:21.066Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/profusion.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-26T01:09:14.000Z","updated_at":"2024-05-21T11:00:51.000Z","dependencies_parsed_at":"2025-01-01T11:51:58.724Z","dependency_job_id":null,"html_url":"https://github.com/profusion/with-props-change-logger","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"f1baacec9aee009ba293c5691d6ea72ce668b9e9"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/profusion%2Fwith-props-change-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/profusion%2Fwith-props-change-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/profusion%2Fwith-props-change-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/profusion%2Fwith-props-change-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/profusion","download_url":"https://codeload.github.com/profusion/with-props-change-logger/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239986917,"owners_count":19729703,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T16:13:02.202Z","updated_at":"2025-11-11T14:03:01.948Z","avatar_url":"https://github.com/profusion.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Log Changed Properties in a React Component\n\nThis HOC (High Order Component) will wrap an existing class or\nfunction component and track properties that changed.\n\nThis is useful if you're building a memoized component but it keeps\nrendering and you want to know the property that is causing that.\n\nIt's meant to be used during development, production builds should\nremove it.\n\n## Example\n\n```typescript\nimport withPropsChangeLogger from '@profusion/with-props-change-logger';\n\nfunction MyComponent(props: { a: number[] }) {\n  return (\n    \u003cdiv\u003e{JSON.stringify(a)}\u003c/div\u003e\n  );\n}\n\nconst LoggedComponent = withPropsChangeLogger(MyComponent);\n\nfunction OtherComponent() {\n  return (\n    \u003cLoggedComponent a={[1, 2, 3, 4, 5, 6, 7, 8]}\u003e\n  );\n}\n```\n\nWhen changed (say from `[1234]` to `[1,2,3,4,5,6,7,8]`), produces:\n\n```\nPROP CHANGED: SimpleComponent a from:\n\t[1234]\nto:\n\t[1,2,3,4,5,6,7,8]\nPROP RE-RENDERED DUE PROPS: SimpleComponent\n```\n\n**NOTE:** objects (including arrays) and functions are compared just\nlike React does, using a _shallow comparison_! It doesn't matter if\nthe properties, array elements or the function body are the same, if\nthe instance is different, they will be logged.\nBe sure to keep it stable (ie: using the old instances) with\n`useMemo()`, `useRef()` or `useCallback()`.\n\n### Verbosity\n\nIf you find the amount of information too verbose, you may want to\nprovide `verbose: false` and it will show only the `typeof` result, such\nas:\n\n```typescript\nconst LoggedComponent = withPropsChangeLogger(MyComponent, {\n  verbose: false,\n});\n```\n\nProduces:\n\n```\nPROP CHANGED: SimpleComponent a from: object to: object\nPROP RE-RENDERED DUE PROPS: SimpleComponent\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprofusion%2Fwith-props-change-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprofusion%2Fwith-props-change-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprofusion%2Fwith-props-change-logger/lists"}