Drax Namespace
The Drax namespace provides convenient access to all Drax components from a single import.
Import
import { Drax } from 'react-native-drax';
Members
| Member | Maps To |
|---|---|
Drax.Provider | DraxProvider |
Drax.View | DraxView |
Drax.List | DraxList |
Drax.Handle | DraxHandle |
Drax.ScrollView | DraxScrollView |
Usage
import { Drax } from 'react-native-drax';
function App() {
return (
<Drax.Provider>
<Drax.View payload="item" draggable>
<Drax.Handle>
<GripIcon />
</Drax.Handle>
<Text>Content</Text>
</Drax.View>
</Drax.Provider>
);
}
Tree-Shaking
Individual imports are still available and recommended for tree-shaking:
import { DraxView, DraxProvider } from 'react-native-drax';