Customer Management Example
Coming soon! This example will demonstrate how to manage customers in your React Native app.
For now, see the Customer Management API documentation for details on available methods.
Quick Preview
import { useEasy } from "@easylabs/react-native";
import { useState, useEffect } from "react";
import { FlatList, Text, View, Button } from "react-native";
function CustomerList() {
const { getCustomers, createCustomer } = useEasy();
const [customers, setCustomers] = useState([]);
useEffect(() => {
loadCustomers();
}, []);
const loadCustomers = async () => {
const result = await getCustomers({ limit: 20 });
setCustomers(result.data);
};
const handleCreate = async () => {
await createCustomer({
first_name: "John",
last_name: "Doe",
email: "john@example.com",
});
loadCustomers();
};
return (
<View>
<Button title="Create Customer" onPress={handleCreate} />
<FlatList
data={customers}
keyExtractor={(item) => item.id}
renderItem={({ item }) => (
<View>
<Text>
{item.first_name} {item.last_name}
</Text>
<Text>{item.email}</Text>
</View>
)}
/>
</View>
);
}