Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Basic post navigation with React and the Wp Rest Api https://since1979.dev/basic-post-navigation-with-react-and-the-wp-rest-api/
mport React, { useState, useEffect } from "react";
import Axios from "axios";
export default function App() {
// ...
useEffect(() => {
Axios.get("https://example.com/wp-json/wp/v2/posts").then(response => {
setPosts(response.data);
});
}, [setPosts]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.