Installing React Wrappers
If you are using Next.js or React, you should install this package to get the developer-friendly component wrappers.
Installation Command
bash
npm install @bagisto-native/reactUsage Preview
Once installed, you can import components like this:
tsx
import dynamic from 'next/dynamic';
const DynamicButton = dynamic(
() => import('@bagisto-native/react').then(mod => mod.DynamicButton),
{ ssr: false }
);Why not standard import?
Because the underlying Web Components reference window and HTMLElement during initialization, standard imports in Next.js (SSR) will cause "window is not defined" errors. Dynamic imports with { ssr: false } solve this.
Next Steps
- Understand Package Dependency Rules
- Explore Hotwire Bridge Bundle
- Learn about Making App Native-Ready
