Skip to content

Commit

Permalink
chore(website): implemented useMemo Hook (#1553)
Browse files Browse the repository at this point in the history
Co-authored-by: Jonas Lagoni <jonas-lt@live.dk>
  • Loading branch information
harshit-senpai and jonaslagoni authored Oct 9, 2023
1 parent c7519c7 commit 856e0ae
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 23 deletions.
8 changes: 7 additions & 1 deletion modelina-website/src/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
import Head from 'next/head';
import { useMemo } from 'react';
import AppContext from '../components/contexts/AppContext';
import Footer from '../components/layouts/Footer';

import '../styles/globals.css';

export default function App({ Component, pageProps, router }: any) {

const contextValue = useMemo(() => {
return { path: router.asPath };
}, [router.asPath])

return (
<AppContext.Provider value={{ path: router.asPath }}>
<AppContext.Provider value={contextValue}>
<Head>
<script async defer src="https://buttons.github.io/buttons.js"></script>
</Head>
Expand Down
33 changes: 11 additions & 22 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 856e0ae

Please sign in to comment.