score:0

Accepted answer
import axios from 'axios';
import React, { useEffect, useState } from 'react';

function TestPage() {
  console.log(process.env.NEXT_PUBLIC_WECODE_URI);

  const [state, setState] = useState();

  const customFetch = async () => {
    const results = await axios.get(`${process.env.NEXT_PUBLIC_WECODE_URI}/testapi`);
    setState(results)
  };

  useEffect(() => {
    customFetch();
  }, []);

  return <div>{state}</div>;
}

export default TestPage;

Related Query

More Query from same tag