Skip to content

Instantly share code, notes, and snippets.

Last active March 4, 2021 15:47
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
import * as React from "react";
import { ColorValue } from "react-native";
import colors from "./colors";
export interface Theme {
primary: ColorValue;
secondary: ColorValue;
// The color for the main background of your interface.
background: ColorValue;
export const defaultTheme: Theme = {
background: colors.mono.white,
export const ThemeContext = React.createContext(defaultTheme);
export function useTheme() {
const theme = React.useContext(ThemeContext);
return theme;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment