React Magnetic DI

React Magnetic DI

Dependency Injection & Replacement for React Components and Hooks


Description

Dependency Injection & Replacement for React Components and Hooks

Overview

react-magnetic-di offers a fresh approach to dependency injection and replacement, suitable for tests, Storybook scenarios, and production experiments.

Key Features

  • Custom Implementation Injection
    Seamlessly provide alternative implementations of components or hooks during testing or while authoring Storybooks.
  • Decorator‑Inspired Design
    Leveraging decorator concepts, Babel transformations, and React Context/globals, the library enables optional overriding of "marked" dependencies within components.
  • Selective Swapping
    Replace implementations only when necessary, keeping the rest of the application unchanged.

This tool streamlines dependency management across development stages while maintaining a clean and maintainable codebase.


Creator

Alberto Gasparin
@albertogasparin

Related Projects

RNRepo

RNRepo

React Native Pre-Built Artifacts

ReactUseKit

ReactUseKit

Collection of React Hooks & Helpers

React Native Builder Bob

React Native Builder Bob

Collection of Tools to Scaffold React Native Libraries

React Simplikit

React Simplikit

React Utility Library

Intlayer

Intlayer

Internationalization & Content Management Solution

React Native Legal

Generate License Acknowledgements