Answers for "how to use express with react"

0

how to connect react to backend

//put inside of package.json
"proxy": "http://localhost:8080"
Posted by: Guest on November-24-2020
0

react and express

constructor(props) {
    super(props);
    this.state = { apiResponse: "" };
}

callAPI() {
    fetch("http://localhost:9000/testAPI")
        .then(res => res.text())
        .then(res => this.setState({ apiResponse: res }));
}

componentWillMount() {
    this.callAPI();
}
Posted by: Guest on January-30-2022

Code answers related to "how to use express with react"

Code answers related to "Javascript"

Browse Popular Code Answers by Language