0
const { default: axios } = require("axios");

i have problem with gettin data. how can I fix this?

  • `require` is used in Node but `import` is used in the browser. – phuzi Mar 02 '22 at 12:39
  • https://stackoverflow.com/questions/23603514/javascript-require-function-giving-referenceerror-require-is-not-defined. Possible duplicate if that one, please check the answers on that question. – Heewoon Mar 02 '22 at 12:39
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Mar 02 '22 at 12:59

1 Answers1

0

you have to import axios library

import axios from 'axios';
jeremy-denis
  • 4,594
  • 3
  • 17
  • 26