Relationship with Core
It is important to understand that @bagisto-native/react is not a standalone implementation. It is a wrapper library that sits on top of @bagisto-native/core.
Dependency Chain
How it works
- The Core: Defines the custom element, e.g.,
<dynamic-button>. This element contains the logic to talk to the Stimulus controller. - The Wrapper: The React component
<DynamicButton />simply renders the<dynamic-button>custom element into the DOM. - The Props: When you pass props like
pageType="home"to the React component, it forwards them as attributes (e.g.,data-page-type="home") to the underlying custom element.
Bundle Requirement
Even if you only install @bagisto-native/react, you must still copy the bundle.js from @bagisto-native/core into your public folder, because the React components ultimately rely on that bundle to communicate with the native app.
Next Steps
- Explore the React Module
- Check Versioning & Compatibility
- Learn about Prerequisites
