How to use the react-native-paper.useTheme function in react-native-paper

To help you get started, we’ve selected a few react-native-paper examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github callstack / react-native-paper / example / src / ExampleList.tsx View on Github external
export default function ExampleList({ navigation }: Props) {
  const renderItem = ({ item }: { item: Item }) => (
     navigation.navigate(item.id)}
    />
  );

  const keyExtractor = (item: { id: string }) => item.id;

  const { colors } = useTheme();
  const safeArea = useSafeArea();

  return (
    
  );
}
github callstack / react-native-paper / example / src / Examples / AppbarExample.tsx View on Github external
export default function AppbarExample({ navigation }: Props) {
  const { colors } = useTheme();

  const [showLeftIcon, setShowLeftIcon] = React.useState(true);
  const [showSubtitle, setShowSubtitle] = React.useState(true);
  const [showSearchIcon, setShowSearchIcon] = React.useState(true);
  const [showMoreIcon, setShowMoreIcon] = React.useState(true);
  const [showCustomColor, setShowCustomColor] = React.useState(false);
  const [showExactTheme, setShowExactTheme] = React.useState(false);

  navigation.setOptions({
    header: () => (