React Deep Force Update

2.1.3 · maintenance · verified Tue Apr 21

react-deep-force-update is a specialized utility library designed to recursively force-update a React component tree, bypassing standard `shouldComponentUpdate` checks. It is explicitly *not* intended for use in production application code, but rather for React development tools, such as hot module reloading or debugging utilities, where a deep update is necessary regardless of component lifecycle optimizations. The current stable version is 2.1.3. It has a very slow release cadence, typically updating only when core React features or deprecations necessitate changes, such as the shift to React 0.14. Its key differentiator is its ability to bypass standard React update mechanisms for development-time introspection and manipulation, providing a granular control not available through standard React APIs. This package serves a niche purpose within the React ecosystem.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to import and use `deepForceUpdate` on a rendered React component instance to force a recursive update, bypassing `shouldComponentUpdate`.

import React from 'react';
import { render } from 'react-dom';
import deepForceUpdate from 'react-deep-force-update';

// A simple React component for demonstration
class MyComponent extends React.Component {
  render() {
    return <div>Hello, {this.props.name}</div>;
  }
}

// Render the component into the DOM
const container = document.createElement('div');
document.body.appendChild(container);
const instance = render(<MyComponent name="World" />, container);

// Simulate an update scenario (e.g., from a dev tool)
setTimeout(() => {
  console.log('Forcing deep update...');
  deepForceUpdate(instance);
  console.log('Deep update complete. Check the console for any React warnings if applicable.');
}, 1000);

view raw JSON →