Skip to content

Instantly share code, notes, and snippets.

@YajanaRao
Last active August 22, 2021 10:46
Show Gist options
  • Save YajanaRao/c89b80c6fd03d4ac2f5294058957d574 to your computer and use it in GitHub Desktop.
Save YajanaRao/c89b80c6fd03d4ac2f5294058957d574 to your computer and use it in GitHub Desktop.
Import ThemeProvider at the top of your React component tree
import * as React from 'react';
import Constants from 'expo-constants';
import { ThemeProvider } from '@shopify/restyle';
// You can import from local files
import theme from './theme';
import AssetExample from './components/AssetExample';
import Box from './components/Box';
import Text from './components/Text';
export default function App() {
return (
<ThemeProvider theme={theme}>
<Box
flex={1}
justifyContent="center"
backgroundColor="mainBackground"
padding="s">
<Text variant="header" textAlign="center">
Hello world
</Text>
<Text variant="paragraph">
Change code in the editor and watch it change on your phone! Save to
get a shareable url.
</Text>
<AssetExample />
</Box>
</ThemeProvider>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment