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