{"_id":"@rc-component/mutate-observer","_rev":"4537434","name":"@rc-component/mutate-observer","description":"React MutateObserver Component","dist-tags":{"latest":"2.0.1"},"maintainers":[{"name":"afc163","email":""},{"name":"chenshuai2144","email":""},{"name":"madccc","email":""},{"name":"peachscript","email":""},{"name":"zombiej","email":""}],"time":{"modified":"2026-04-09T15:01:16.000Z","created":"2023-01-05T14:25:19.943Z","2.0.1":"2025-11-28T03:02:42.339Z","2.0.0":"2025-01-24T10:36:01.452Z","1.1.0":"2023-08-07T11:40:57.223Z","1.0.0":"2023-01-09T03:45:23.668Z","1.0.0-alpha.1":"2023-01-05T14:25:19.943Z"},"users":{},"author":{"name":"574980606@qq.com"},"repository":{"type":"git","url":"git+https://github.com/react-component/mutate-observer.git"},"versions":{"2.0.1":{"name":"@rc-component/mutate-observer","version":"2.0.1","description":"React MutateObserver Component","keywords":["react","react-component","mutate-observer"],"homepage":"https://github.com/react-component/mutate-observer","bugs":{"url":"https://github.com/react-component/mutate-observer/issues"},"repository":{"type":"git","url":"git+https://github.com/react-component/mutate-observer.git"},"license":"MIT","author":{"name":"574980606@qq.com"},"main":"./lib/index","module":"./es/index","typings":"es/index.d.ts","scripts":{"compile":"father build","deploy":"npm run docs:build && npm run docs:deploy","docs:build":"dumi build","docs:deploy":"gh-pages -d docs-dist","lint":"eslint src/ --ext .tsx,.ts","lint:tsc":"tsc -p tsconfig.json --noEmit","now-build":"npm run docs:build","prepare":"dumi setup","prepublishOnly":"npm run compile && rc-np","prettier":"prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"","start":"dumi dev","test":"umi-test","test:coverage":"npm run test --coverage","watch":"father dev"},"dependencies":{"@rc-component/util":"^1.2.0"},"devDependencies":{"@rc-component/father-plugin":"^2.0.2","@rc-component/np":"^1.0.3","@testing-library/jest-dom":"^5.16.4","@testing-library/react":"^13.0.0","@types/jest":"^26.0.20","@types/node":"^22.10.7","@types/react":"^19.0.7","@types/react-dom":"^19.0.3","@umijs/fabric":"^3.0.0","cheerio":"1.0.0-rc.12","dumi":"^2.0.0","eslint":"^8.54.0","eslint-plugin-jest":"^27.6.0","eslint-plugin-unicorn":"^49.0.0","father":"^4.0.0","gh-pages":"^3.1.0","glob":"^10.0.0","prettier":"^2.1.2","react":"^18.0.0","react-dom":"^18.0.0","typescript":"^5.0.0","umi-test":"^1.9.7"},"peerDependencies":{"react":">=16.9.0","react-dom":">=16.9.0"},"engines":{"node":">=8.x"},"_id":"@rc-component/mutate-observer@2.0.1","gitHead":"5455ccbb133ad5db622b1888e32b424108feeacf","_nodeVersion":"22.8.0","_npmVersion":"11.6.0","dist":{"shasum":"78f54a23bff7c62b2137dfb67e063c1be6ac0652","size":4286,"noattachment":false,"key":"/@rc-component/mutate-observer/-/@rc-component/mutate-observer-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/@rc-component/mutate-observer/download/@rc-component/mutate-observer-2.0.1.tgz"},"_npmUser":{"name":"afc163","email":"afc163@gmail.com"},"directories":{},"maintainers":[{"name":"afc163","email":""},{"name":"chenshuai2144","email":""},{"name":"madccc","email":""},{"name":"peachscript","email":""},{"name":"zombiej","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mutate-observer_2.0.1_1764298962123_0.7670633499731787"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-11-28T03:02:42.339Z","publish_time":1764298962339,"_source_registry_name":"default","_cnpm_publish_time":1764298962339},"2.0.0":{"name":"@rc-component/mutate-observer","version":"2.0.0","description":"React MutateObserver Component","keywords":["react","react-component","mutate-observer"],"homepage":"https://github.com/react-component/mutate-observer","bugs":{"url":"https://github.com/react-component/mutate-observer/issues"},"repository":{"type":"git","url":"git+https://github.com/react-component/mutate-observer.git"},"license":"MIT","author":{"name":"574980606@qq.com"},"main":"./lib/index","module":"./es/index","typings":"es/index.d.ts","scripts":{"compile":"father build","deploy":"npm run docs:build && npm run docs:deploy","docs:build":"dumi build","docs:deploy":"gh-pages -d docs-dist","lint":"eslint src/ --ext .tsx,.ts","lint:tsc":"tsc -p tsconfig.json --noEmit","now-build":"npm run docs:build","prepare":"dumi setup","prepublishOnly":"npm run compile && rc-np","prettier":"prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"","start":"dumi dev","test":"umi-test","test:coverage":"npm run test --coverage","watch":"father dev"},"dependencies":{"@rc-component/util":"^1.2.0","classnames":"^2.3.2"},"devDependencies":{"@rc-component/father-plugin":"^2.0.2","@rc-component/np":"^1.0.3","@testing-library/jest-dom":"^5.16.4","@testing-library/react":"^13.0.0","@types/jest":"^26.0.20","@types/node":"^22.10.7","@types/react":"^19.0.7","@types/react-dom":"^19.0.3","@umijs/fabric":"^3.0.0","cheerio":"1.0.0-rc.12","dumi":"^2.0.0","eslint":"^8.54.0","eslint-plugin-jest":"^27.6.0","eslint-plugin-unicorn":"^49.0.0","father":"^4.0.0","gh-pages":"^3.1.0","glob":"^10.0.0","prettier":"^2.1.2","react":"^18.0.0","react-dom":"^18.0.0","typescript":"^5.0.0","umi-test":"^1.9.7"},"peerDependencies":{"react":">=16.9.0","react-dom":">=16.9.0"},"engines":{"node":">=8.x"},"_id":"@rc-component/mutate-observer@2.0.0","gitHead":"f11ce0fc0400008812c9d0395fe992c12f1a34ad","_nodeVersion":"22.5.1","_npmVersion":"10.8.2","dist":{"shasum":"57caaf9361da06b218e0ca14d9b16e81aa3c1e94","size":4145,"noattachment":false,"key":"/@rc-component/mutate-observer/-/@rc-component/mutate-observer-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@rc-component/mutate-observer/download/@rc-component/mutate-observer-2.0.0.tgz"},"_npmUser":{"name":"zombiej","email":"smith3816@gmail.com"},"directories":{},"maintainers":[{"name":"afc163","email":""},{"name":"chenshuai2144","email":""},{"name":"madccc","email":""},{"name":"peachscript","email":""},{"name":"zombiej","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mutate-observer_2.0.0_1737714961244_0.6842253833879859"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-01-24T10:36:01.452Z","publish_time":1737714961452,"_source_registry_name":"default","_cnpm_publish_time":1737714961452},"1.1.0":{"name":"@rc-component/mutate-observer","version":"1.1.0","description":"React MutateObserver Component","keywords":["react","react-component","mutate-observer"],"homepage":"https://github.com/react-component/mutate-observer","bugs":{"url":"https://github.com/react-component/mutate-observer/issues"},"repository":{"type":"git","url":"git+https://github.com/react-component/mutate-observer.git"},"license":"MIT","author":{"name":"574980606@qq.com"},"main":"./lib/index","module":"./es/index","typings":"es/index.d.ts","scripts":{"compile":"father build","deploy":"npm run docs:build && npm run docs:deploy","docs:build":"dumi build","docs:deploy":"gh-pages -d docs-dist","lint":"eslint src/ --ext .tsx,.ts","lint:tsc":"tsc -p tsconfig.json --noEmit","now-build":"npm run docs:build","prepublishOnly":"npm run compile && np --no-cleanup --yolo --no-publish","prettier":"prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"","start":"dumi dev","test":"umi-test","test:coverage":"npm run test --coverage","watch":"father dev"},"dependencies":{"@babel/runtime":"^7.18.0","classnames":"^2.3.2","rc-util":"^5.24.4"},"devDependencies":{"@rc-component/father-plugin":"^1.0.0","@testing-library/jest-dom":"^5.16.4","@testing-library/react":"^13.0.0","@types/jest":"^26.0.20","@types/react":"^18.0.0","@types/react-dom":"^18.0.0","@umijs/fabric":"^2.5.2","dumi":"^1.1.0","eslint":"^7.18.0","father":"^4.0.0-rc.8","gh-pages":"^3.1.0","np":"^5.0.3","prettier":"^2.1.2","react":"^18.0.0","react-dom":"^18.0.0","typescript":"^4.6.3","umi-test":"^1.9.7"},"peerDependencies":{"react":">=16.9.0","react-dom":">=16.9.0"},"engines":{"node":">=8.x"},"gitHead":"63678092b439032d0fd8152f49c2853a5bfd3934","_id":"@rc-component/mutate-observer@1.1.0","_nodeVersion":"16.17.0","_npmVersion":"8.19.2","dist":{"shasum":"ee53cc88b78aade3cd0653609215a44779386fd8","size":4769,"noattachment":false,"key":"/@rc-component/mutate-observer/-/@rc-component/mutate-observer-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@rc-component/mutate-observer/download/@rc-component/mutate-observer-1.1.0.tgz"},"_npmUser":{"name":"zombiej","email":"smith3816@gmail.com"},"directories":{},"maintainers":[{"name":"afc163","email":""},{"name":"chenshuai2144","email":""},{"name":"madccc","email":""},{"name":"peachscript","email":""},{"name":"zombiej","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mutate-observer_1.1.0_1691408457055_0.09402694647188259"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-08-07T11:40:57.223Z","publish_time":1691408457223,"_source_registry_name":"default","_cnpm_publish_time":1691408457223},"1.0.0":{"name":"@rc-component/mutate-observer","version":"1.0.0","description":"React MutateObserver Component","keywords":["react","react-component","mutate-observer"],"homepage":"https://github.com/react-component/mutate-observer","bugs":{"url":"https://github.com/react-component/mutate-observer/issues"},"repository":{"type":"git","url":"git+https://github.com/react-component/mutate-observer.git"},"license":"MIT","author":{"name":"574980606@qq.com"},"main":"./lib/index","module":"./es/index","typings":"es/index.d.ts","scripts":{"compile":"father build","deploy":"npm run docs:build && npm run docs:deploy","docs:build":"dumi build","docs:deploy":"gh-pages -d docs-dist","lint":"eslint src/ --ext .tsx,.ts","lint:tsc":"tsc -p tsconfig.json --noEmit","now-build":"npm run docs:build","prepublishOnly":"npm run compile && np --no-cleanup --yolo --no-publish","prettier":"prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"","start":"dumi dev","test":"npm run test:client && npm run test:server","test:client":"umi-test --testPathIgnorePatterns=ssr.test.tsx --testPathIgnorePatterns=ssr.test.tsx","test:coverage":"npm run test:client --coverage","test:server":"umi-test --env=node -- tests/ssr.test.tsx","watch":"father dev"},"dependencies":{"@babel/runtime":"^7.18.0","classnames":"^2.3.2","rc-util":"^5.24.4"},"devDependencies":{"@rc-component/father-plugin":"^1.0.0","@testing-library/jest-dom":"^5.16.4","@testing-library/react":"^13.0.0","@types/jest":"^26.0.20","@types/react":"^18.0.0","@types/react-dom":"^18.0.0","@umijs/fabric":"^2.5.2","dumi":"^1.1.0","eslint":"^7.18.0","father":"^4.0.0-rc.8","gh-pages":"^3.1.0","np":"^5.0.3","prettier":"^2.1.2","react":"^18.0.0","react-dom":"^18.0.0","typescript":"^4.6.3","umi-test":"^1.9.7"},"peerDependencies":{"react":">=16.9.0","react-dom":">=16.9.0"},"engines":{"node":">=8.x"},"gitHead":"17d6a6b34999799067f5fe6bc6ed46723d7647b0","_id":"@rc-component/mutate-observer@1.0.0","_nodeVersion":"16.17.0","_npmVersion":"8.19.2","dist":{"shasum":"ce99af3239ed9c74ee3e7302f1c67098de920b46","size":4384,"noattachment":false,"key":"/@rc-component/mutate-observer/-/@rc-component/mutate-observer-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@rc-component/mutate-observer/download/@rc-component/mutate-observer-1.0.0.tgz"},"_npmUser":{"name":"zombiej","email":"smith3816@gmail.com"},"directories":{},"maintainers":[{"name":"afc163","email":""},{"name":"chenshuai2144","email":""},{"name":"madccc","email":""},{"name":"peachscript","email":""},{"name":"zombiej","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mutate-observer_1.0.0_1673235923482_0.10469956175696504"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-01-09T03:45:23.668Z","publish_time":1673235923668,"_cnpm_publish_time":1673235923668},"1.0.0-alpha.1":{"name":"@rc-component/mutate-observer","version":"1.0.0-alpha.1","description":"React MutateObserver Component","keywords":["react","react-component","mutate-observer"],"homepage":"https://github.com/react-component/mutate-observer","bugs":{"url":"https://github.com/react-component/mutate-observer/issues"},"repository":{"type":"git","url":"git+https://github.com/react-component/mutate-observer.git"},"license":"MIT","author":{"name":"574980606@qq.com"},"main":"./lib/index","module":"./es/index","typings":"es/index.d.ts","scripts":{"compile":"father build","deploy":"npm run docs:build && npm run docs:deploy","docs:build":"dumi build","docs:deploy":"gh-pages -d docs-dist","lint":"eslint src/ --ext .tsx,.ts","lint:tsc":"tsc -p tsconfig.json --noEmit","now-build":"npm run docs:build","prepublishOnly":"npm run compile && np --no-cleanup --yolo --no-publish","prettier":"prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"","start":"dumi dev","test":"npm run test:client && npm run test:server","test:client":"umi-test --testPathIgnorePatterns=ssr.test.tsx --testPathIgnorePatterns=ssr.test.tsx","test:coverage":"npm run test:client --coverage","test:server":"umi-test --env=node -- tests/ssr.test.tsx","watch":"father dev"},"dependencies":{"@babel/runtime":"^7.18.0","classnames":"^2.3.2","rc-util":"^5.24.4"},"devDependencies":{"@rc-component/father-plugin":"^1.0.0","@testing-library/jest-dom":"^5.16.4","@testing-library/react":"^13.0.0","@types/jest":"^26.0.20","@types/react":"^18.0.0","@types/react-dom":"^18.0.0","@umijs/fabric":"^2.5.2","dumi":"^1.1.0","eslint":"^7.18.0","father":"^4.0.0-rc.8","gh-pages":"^3.1.0","np":"^5.0.3","prettier":"^2.1.2","react":"^18.0.0","react-dom":"^18.0.0","typescript":"^4.6.3","umi-test":"^1.9.7"},"peerDependencies":{"react":">=16.9.0","react-dom":">=16.9.0"},"engines":{"node":">=8.x"},"gitHead":"b3aec81e150470a144e88f874be890dfd36717e9","_id":"@rc-component/mutate-observer@1.0.0-alpha.1","_nodeVersion":"16.17.0","_npmVersion":"8.19.2","dist":{"shasum":"9e41b167745147598f52ae233f12360253e3ab92","size":4388,"noattachment":false,"key":"/@rc-component/mutate-observer/-/@rc-component/mutate-observer-1.0.0-alpha.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/@rc-component/mutate-observer/download/@rc-component/mutate-observer-1.0.0-alpha.1.tgz"},"_npmUser":{"name":"zombiej","email":"smith3816@gmail.com"},"directories":{},"maintainers":[{"name":"afc163","email":""},{"name":"chenshuai2144","email":""},{"name":"madccc","email":""},{"name":"peachscript","email":""},{"name":"zombiej","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mutate-observer_1.0.0-alpha.1_1672928719739_0.8683323535012535"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-01-05T16:10:28.040Z","publish_time":1672928719943,"_cnpm_publish_time":1672928719943}},"readme":"# @rc-component/mutate-observer\n\nMutateObserver for React.\n\n\n[![NPM version][npm-image]][npm-url]\n[![npm download][download-image]][download-url]\n[![build status][github-actions-image]][github-actions-url]\n[![Codecov][codecov-image]][codecov-url]\n[![bundle size][bundlephobia-image]][bundlephobia-url]\n[![dumi][dumi-image]][dumi-url]\n\n[npm-image]: https://img.shields.io/npm/v/@rc-component/mutate-observer.svg?style=flat-square\n[npm-url]: http://npmjs.org/package/@rc-component/mutate-observer\n[github-actions-image]: https://github.com/react-component/mutate-observer/actions/workflows/main.yml/badge.svg\n[github-actions-url]: https://github.com/react-component/mutate-observer/actions/workflows/main.yml\n[codecov-image]: https://img.shields.io/codecov/c/github/react-component/mutate-observer/master.svg?style=flat-square\n[codecov-url]: https://app.codecov.io/gh/react-component/mutate-observer\n[david-url]: https://david-dm.org/react-component/mutate-observer\n[david-image]: https://david-dm.org/react-component/mutate-observer/status.svg?style=flat-square\n[david-dev-url]: https://david-dm.org/react-component/mutate-observer?type=dev\n[david-dev-image]: https://david-dm.org/react-component/mutate-observer/dev-status.svg?style=flat-square\n[download-image]: https://img.shields.io/npm/dm/@rc-component/mutate-observer.svg?style=flat-square\n[download-url]: https://npmjs.org/package/@rc-component/mutate-observer\n[bundlephobia-url]: https://bundlephobia.com/package/@rc-component/mutate-observer\n[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/@rc-component/mutate-observer\n[dumi-url]: https://github.com/umijs/dumi\n[dumi-image]: https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square\n\n## Development\n\n```bash\nnpm install\nnpm run start\nopen http://localhost:8000\n```\n\n## Install\n\n[![@rc-component/mutate-observer](https://nodei.co/npm/@rc-component/mutate-observer.png)](https://www.npmjs.com/package/@rc-component/mutate-observer)\n\n## Usage\n\n```tsx | pure\nimport React from 'react';\nimport MutateObserver from 'rc-component/mutate-observer';\n\nconst onMutate = (mutations: MutationRecord[], observer: MutationObserver) => {\n  console.log(mutation);\n  console.log(observer);\n};\n\nconst Demo: React.FC = () => {\n  return (\n    <MutateObserver onMutate={onMutate}>\n      <div>test</div>\n    </MutateObserver>\n  );\n};\n\nexport default Demo;\n```\n\n## ???? API\n\nWe use typescript to create the Type definition. You can view directly in IDE. But you can still check the type definition [here](https://github.com/react-component/mutate-observer/blob/master/src/interface.ts).\n\n### mutate-observer\n\n| Prop     | Description                                                                                                      | Type                 | Default |\n| -------- | ---------------------------------------------------------------------------------------------------------------- | -------------------- | ------- |\n| onMutate | A function which will be called on each DOM change that qualifies given the observed node or subtree and options | MutationCallback     | -       |\n| options  | An object providing options that describe which DOM mutations should be reported to mutationObserver's callback  | MutationObserverInit | -       |\n","_attachments":{},"homepage":"https://github.com/react-component/mutate-observer","bugs":{"url":"https://github.com/react-component/mutate-observer/issues"},"license":"MIT"}