{"id":13726988,"url":"https://github.com/alloc/react-batched-updates","last_synced_at":"2026-02-15T15:09:25.374Z","repository":{"id":107078532,"uuid":"354027523","full_name":"alloc/react-batched-updates","owner":"alloc","description":"Cross platform unstable_batchedUpdates for React libraries","archived":false,"fork":false,"pushed_at":"2021-08-10T19:49:07.000Z","size":5,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T07:28:21.689Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/alloc.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}},"created_at":"2021-04-02T13:28:28.000Z","updated_at":"2021-08-10T19:49:09.000Z","dependencies_parsed_at":"2023-04-20T21:32:45.958Z","dependency_job_id":null,"html_url":"https://github.com/alloc/react-batched-updates","commit_stats":{"total_commits":6,"total_committers":1,"mean_commits":6.0,"dds":0.0,"last_synced_commit":"187dae5d4c727cc4cf7475f4f85c9a14c3e74bd3"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alloc%2Freact-batched-updates","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alloc%2Freact-batched-updates/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alloc%2Freact-batched-updates/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alloc%2Freact-batched-updates/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alloc","download_url":"https://codeload.github.com/alloc/react-batched-updates/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248571324,"owners_count":21126516,"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-08-03T01:03:34.505Z","updated_at":"2026-02-15T15:09:25.328Z","avatar_url":"https://github.com/alloc.png","language":"TypeScript","funding_links":["https://paypal.me/alecdotbiz"],"categories":["TypeScript"],"sub_categories":[],"readme":"# react-batched-updates\n\n[![npm](https://img.shields.io/npm/v/react-batched-updates.svg)](https://www.npmjs.com/package/react-batched-updates)\n[![Code style: Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://paypal.me/alecdotbiz)\n\n\u003e Cross platform unstable_batchedUpdates\n\n\u0026nbsp;\n\n## Usage\n\n```ts\nimport { batchedUpdates } from 'react-batched-updates'\n\nbatchedUpdates(() =\u003e {\n  // Any setState calls are batched, instead of triggering \n  // multiple render passes.\n})\n```\n\nYou should call `setBatchedUpdates` or else `batchedUpdates` will be ineffective. \nExcept for React Native users, where the bundler prefers `cjs/index.native.js`, \na module that requires `react-native` to achieve zero configuration.\n\n```ts\nimport { setBatchedUpdates } from 'react-batched-updates'\nimport { unstable_batchedUpdates } from 'react-dom'\n\n// Both react-native and react-dom have this export.\nsetBatchedUpdates(unstable_batchedUpdates)\n```\n\nIn test environments, you can usually replace `unstable_batchedUpdates` with `act`.\n\n```ts\nimport { setBatchedUpdates } from 'react-batched-updates'\nimport { act } from '@testing-library/react'\n\nsetBatchedUpdates(act)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falloc%2Freact-batched-updates","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falloc%2Freact-batched-updates","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falloc%2Freact-batched-updates/lists"}