From 637f4efad4703c8cc39b31f6323e5a363084d667 Mon Sep 17 00:00:00 2001 From: alifnaufalyasin Date: Fri, 20 Oct 2023 23:22:54 +0700 Subject: [PATCH] udpate --- pages/member.jsx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/pages/member.jsx b/pages/member.jsx index bcba86fa..cd414543 100644 --- a/pages/member.jsx +++ b/pages/member.jsx @@ -11,10 +11,8 @@ import { import { motion } from "framer-motion"; import CardAnggota from "../components/CardAnggota" import { NextSeo } from "next-seo"; - -export default async function member() { - const file = await fs.readFile(process.cwd() + '/data/dataMember.json', 'utf8'); - const dataAnggota = JSON.parse(file); +const member = (props) => { + const { dataAnggota } = props // const [dataAnggota, setDataAnggota] = React.useState(false); const MotionBox = motion(Box) const year = new Date().getFullYear() @@ -112,3 +110,12 @@ export default async function member() { ); } }; + +member.getInitialProps = async () => { + const file = await fs.readFile(process.cwd() + '/data/dataMember.json', 'utf8'); + const data = JSON.parse(file); + return {dataAnggota: data}; + +} + +export default member;