* Mark a component as needing a rerender, adding an optional callback to a * list of functions which will be executed once the rerender occurs.
(component)
| 2272 | * list of functions which will be executed once the rerender occurs. |
| 2273 | */ |
| 2274 | function enqueueUpdate(component) { |
| 2275 | ensureInjected(); |
| 2276 | |
| 2277 | // Various parts of our code (such as ReactCompositeComponent's |
| 2278 | // _renderValidatedComponent) assume that calls to render aren't nested; |
| 2279 | // verify that that's the case. (This is called by each top-level update |
| 2280 | // function, like setState, forceUpdate, etc.; creation and |
| 2281 | // destruction of top-level components is guarded in ReactMount.) |
| 2282 | |
| 2283 | if (!batchingStrategy.isBatchingUpdates) { |
| 2284 | batchingStrategy.batchedUpdates(enqueueUpdate, component); |
| 2285 | return; |
| 2286 | } |
| 2287 | |
| 2288 | dirtyComponents.push(component); |
| 2289 | if (component._updateBatchNumber == null) { |
| 2290 | component._updateBatchNumber = updateBatchNumber + 1; |
| 2291 | } |
| 2292 | } |
| 2293 | |
| 2294 | /** |
| 2295 | * Enqueue a callback to be run at the end of the current batching cycle. Throws |
no test coverage detected