File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -95,25 +95,30 @@ export default function Committee({ committeeData = {} }) {
9595// -----------------------------
9696// Data fetching
9797// -----------------------------
98- export async function getStaticProps ( ) {
99- try {
100- const res = await fetch (
101- "https://wrcrobotics.pythonanywhere.com/committee"
102- ) ;
103-
104- const committeeData = await res . json ( ) ;
105-
106- return {
107- props : { committeeData } ,
108- revalidate : 10 ,
109- } ;
110- } catch ( err ) {
111- return {
112- props : { committeeData : { } } ,
113- revalidate : 10 ,
114- } ;
115- }
116- }
98+ // export async function getStaticProps() {
99+ // try {
100+ // const res = await fetch(
101+ // "https://wrcrobotics.pythonanywhere.com/committee"
102+ // );
103+
104+ // const committeeData = await res.json();
105+
106+ // return {
107+ // props: { committeeData },
108+ // revalidate: 10,
109+ // };
110+ // } catch (err) {
111+ // return {
112+ // props: { committeeData: {} },
113+ // revalidate: 10,
114+ // };
115+ // }
116+ // }
117+ useEffect ( ( ) => {
118+ fetch ( "https://wrcrobotics.pythonanywhere.com/committee" )
119+ . then ( res => res . json ( ) )
120+ . then ( setData ) ;
121+ } , [ ] ) ;
117122
118123// -----------------------------
119124// Styles (cleaned)
You can’t perform that action at this time.
0 commit comments