Skip to main content

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

NamespaceComponent
Drax.ProviderDraxProvider
Drax.ViewDraxView
Drax.ListDraxList
Drax.HandleDraxHandle
Drax.ScrollViewDraxScrollView

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