Skip to main content

πŸ–₯️ Navigation, modules, theme (React Native)

After connect, the sdk from useAzeoo() exposes:

  • sdk.navigate(...) + back operations β€” typed navigation
  • sdk.setModuleContainer(...) β€” keep your JS-side native nav in sync
  • <NutritionView /> / <TrainingView /> β€” embedded module views
  • Theme + display helpers

Typed navigation​

import { Destination } from 'react-native-azeoo-lib';

await sdk.navigate(Destination.nutrition.plan('abc-123'));
await sdk.navigate(Destination.training.workouts());
await sdk.goBack();
await sdk.backToRoot();
const can = await sdk.canGoBack();
const current = await sdk.getCurrentRoute();

Full catalogue: Destination catalogue (nutrition + training).

Module coordinator (setModuleContainer)​

RN's native nav (React Navigation, custom tab bars, drawers) lives in JS, so the SDK can't directly flip it β€” but you give the SDK a tiny callback once, and cross-module sdk.navigate(...) will keep your JS state in sync:

useEffect(() => {
if (!sdk) return;
sdk.setModuleContainer((module) => {
if (module === 'nutrition') { navigation.navigate('NutritionTab'); return true; }
if (module === 'training') { navigation.navigate('TrainingTab'); return true; }
return false;
});
return () => sdk.setModuleContainer(null);
}, [sdk]);

Embedding​

import { NutritionView, TrainingView } from 'react-native-azeoo-lib';

<NutritionView bottomSafeArea={false} onLoad={...} onError={...} />
<TrainingView bottomSafeArea={false} onLoad={...} onError={...} />

Module display helpers​

await sdk.showNutrition(true);
await sdk.hideNutrition();
await sdk.showTraining(true);
await sdk.hideTraining();
await sdk.displayNutritionModal(false);
await sdk.dismissNutritionModal();

These control whether the module surface is visible β€” they're complementary to navigation, not a replacement.

Theme​

await sdk.setThemeMode(1); // 0=light, 1=dark, 2=system
const mode = await sdk.getThemeMode();

See also​