Dynamic Imports
We strongly recommend using next/dynamic for importing ANY component from this library.
Standard Pattern
tsx
import dynamic from 'next/dynamic';
const DynamicButton = dynamic(
() => import('@bagisto-native/react').then((mod) => mod.DynamicButton),
{ ssr: false }
);This ensures that:
- The code is split into a separate chunk.
- The server does not attempt to execute the component code.
- The component only loads after the browser has hydrated.
Next Steps
- Understand Client-only Components
- Learn about SSR Limitations
- Explore the Components Reference
