made with react.js

React Magnetic DI

Dependency Injection & Replacement for React Components and Hooks

Visit Site

Description

Dependency Injection & Replacement for React Components and Hooks

"react-magnetic-di is a new take for dependency injection / dependency replacement for your tests, storybooks and even experiments in production.

Dependency injection and component injection is not a new topic. Especially the ability to provide a custom implementation of a component/hook while testing or writing storybooks and examples it is extremely valuable. react-magnetic-di takes inspiration from decorators, and with a touch of Babel magic and React Context / globals allows you to optionally override "marked" dependencies inside your components so you can swap implementations only when needed."


Creator

Alberto Gasparin
@albertogasparin


Social Media Links

useIsMountedRef Check when a Component is mounted
icon-eye-dark Created with Sketch. 278
React PDF πŸ“„ Create PDF files using React
icon-eye-dark Created with Sketch. 3.250
Sentry for React React Application Monitoring
πŸ’™ Sponsored by Friends
We’re hosting on Digital Ocean! πŸ’™ Try it today and get a free $100 credit.
React Cool Onclickoutside Listen for Clicks outside of Components
icon-eye-dark Created with Sketch. 553
TanStack Virtual for React Virtualization Library
icon-eye-dark Created with Sketch. 224