react-native-hardwired v0.10.2 enables runtime dynamic imports of pre-compiled React Native modules, bridging the gap between static bundling and deferred loading. Unlike standard React Native's static require or Metro's lazy loading, this library works with modules already transpiled by Babel/TypeScript, allowing you to load code on demand without ejection or native changes. It ships TypeScript definitions and is released on npm with monthly cadence. Key differentiator: no native modules, works with Hermes, and integrates directly with Metro's require system.
npm install react-native-hardwiredNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows creating a Hardwired loader and dynamically importing a precompiled module at runtime.
Set up a build step (e.g., Babel) to transpile your dynamic modules into CommonJS before bundling with Metro.
Use paths like './modules' or '../src/dynamic' that resolve relative to the project root.
Update to new constructor with explicit baseDir: const loader = new Hardwired({ baseDir: './dyn' });Use async/await or .then() instead of passing a callback to loader.load().
Change 'import Hardwired from ...' to 'import { Hardwired } from ...'Verify baseDir and module name. Ensure the module file exists and is precompiled.
Add a build step that outputs CommonJS with module.exports.
No dependency data recorded yet.