Last active
November 2, 2022 18:52
-
-
Save wontondon/27ccacb2bd59c3fe9265460e6c96c1d1 to your computer and use it in GitHub Desktop.
Sample Next 13 w/ Chakra context
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use client'; | |
import React, { useState } from 'react'; | |
import { ChakraProvider } from '@chakra-ui/react'; | |
import { theme } from './theme'; | |
export default function ContextProviders({ | |
children, | |
}: { | |
children: React.ReactNode; | |
}) { | |
return ( | |
<ChakraProvider theme={theme}> | |
{children} | |
</ChakraProvider> | |
); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ContextProviders from './context-providers'; | |
export default function RootLayout({ | |
children, | |
}: { | |
children: React.ReactNode; | |
}) { | |
return ( | |
<html lang="en"> | |
<head> | |
<title>Example</title> | |
</head> | |
<body> | |
<ContextProviders>{children}</ContextProviders> | |
</body> | |
</html> | |
); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use client'; | |
import { Box } from '@chakra-ui/react'; | |
export default function Home() { | |
return <Box bg="red.100">Example</Box>; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment