Skip to main content

useMapNativeTheme

Maps the theme to a React Navigation Theme object. Use this when you need to keep React Navigation's internal styling (header background, card color, text, borders) in sync with the active color scheme and font family.

Usage

import { useMapNativeTheme } from '@multinaire/ui';
import { NavigationContainer } from '@react-navigation/native';

export default function App() {
const theme = useMapNativeTheme();

return (
<NavigationContainer theme={theme}>
{/* screens */}
</NavigationContainer>
);
}

Return Value

Returns a React Navigation Theme object that re-computes whenever the color scheme or fonts change.

Fieldsource
darktrue when theme mode is 'dark'
colors.primarycolors.primary
colors.backgroundcolors.background
colors.cardcolors.backgroundVariant
colors.textcolors.onBackground
colors.bordercolors.neutral
colors.notificationcolors.error
fonts.regular.fontFamilyfonts.body.regular.fontFamily
fonts.medium.fontFamilyfonts.body.medium.fontFamily
fonts.bold.fontFamilyfonts.body.bold.fontFamily
fonts.heavy.fontFamilyfonts.body.bold.fontFamily

Notes

  • Must be called inside a MultinaireUI.
  • The returned object is memoised — a new reference is only produced when colors, fonts, or themeMode change.