Namespace API
For convenience, all Drax components are available under a single Drax namespace.
Usage
import { Drax } from 'react-native-drax';
<Drax.Provider>
<Drax.View draggable payload="item">
<Drax.Handle>
<GripIcon />
</Drax.Handle>
<Text>Drag by the handle</Text>
</Drax.View>
<Drax.ScrollView>
<Drax.View receptive onReceiveDragDrop={handleDrop}>
<Text>Drop here</Text>
</Drax.View>
</Drax.ScrollView>
</Drax.Provider>
Available Members
| Namespace | Component |
|---|---|
Drax.Provider | DraxProvider |
Drax.View | DraxView |
Drax.List | DraxList |
Drax.Handle | DraxHandle |
Drax.ScrollView | DraxScrollView |
Individual Imports
Individual exports still work for tree-shaking:
import { DraxView, DraxProvider } from 'react-native-drax';
Both import styles are supported — choose whichever fits your codebase.
Next Steps
- Getting Started — Setup guide
- API: Drax Namespace — Full reference