I am learning react js with magento. I want to use magento rest api in my react js app how can i do that ?
1 Answer
In your React component call a fetch request like below:
import React from "react";
function App() {
fetch("http://localhost/magento2/rest/V1/categories")
.then((response) => response.json())
.then((json) => console.log(json));
return <div className="App">{}</div>;
}
export default App;