Answer the question
In order to leave comments, you need to log in
How does the Wordpress Rest API plugin work?
Hello. I read a lot of examples about integrating React with Wordpress using the REST API plugin, but I had a question about accessing endpoints via links. Here is the code
componentDidMount() {
return fetch(`http://www.aaaddd.com/wp-json/wp/v2/posts/`)
.then((response) => response.json())
.then((responseJson) => {
// Update state here
})
.catch((error) => {
console.error(error);
});
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question