that is 1 hour im never getting back
parent
cc8d04154e
commit
ca9923c081
|
@ -3181,6 +3181,14 @@
|
|||
"resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.3.4.tgz",
|
||||
"integrity": "sha512-4Hk6iSA/H90rtiPoCpSkeJxNWCPBf7szwVvaUqrPdxo0j2Y04suHK9jPKXaE3WI7OET6wBSwsWw7FDc1DBq7iQ=="
|
||||
},
|
||||
"axios": {
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-0.24.0.tgz",
|
||||
"integrity": "sha512-Q6cWsys88HoPgAaFAVUb0WpPk0O8iTeisR9IMqy9G8AbO4NlpVknrnQS03zzF9PGAWgO3cgletO3VjV/P7VztA==",
|
||||
"requires": {
|
||||
"follow-redirects": "^1.14.4"
|
||||
}
|
||||
},
|
||||
"axobject-query": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-2.2.0.tgz",
|
||||
|
@ -8174,6 +8182,11 @@
|
|||
"istanbul-lib-report": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"jQuery": {
|
||||
"version": "1.7.4",
|
||||
"resolved": "https://registry.npmjs.org/jQuery/-/jQuery-1.7.4.tgz",
|
||||
"integrity": "sha1-8y3FyFpwRO6GS0RDue5F+UeLoTc="
|
||||
},
|
||||
"jest": {
|
||||
"version": "26.6.0",
|
||||
"resolved": "https://registry.npmjs.org/jest/-/jest-26.6.0.tgz",
|
||||
|
|
|
@ -7,6 +7,9 @@
|
|||
"@testing-library/jest-dom": "^5.14.1",
|
||||
"@testing-library/react": "^11.2.7",
|
||||
"@testing-library/user-event": "^12.8.3",
|
||||
"axios": "^0.24.0",
|
||||
"express": "^4.17.1",
|
||||
"jQuery": "^1.7.4",
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2",
|
||||
"react-scripts": "4.0.3",
|
||||
|
|
13
src/App.js
13
src/App.js
|
@ -1,5 +1,5 @@
|
|||
import React, { Component } from 'react';
|
||||
|
||||
const axios = require('axios');
|
||||
class App extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
@ -7,9 +7,13 @@ class App extends Component {
|
|||
message: "Default Content"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
asyncCall = async () => {
|
||||
return axios.get('https://raw.githubusercontent.com/Senior-Design-2021-Ebook-Team/markdown-parser/main/fpb.json');
|
||||
}
|
||||
|
||||
updateContent = () => {
|
||||
if (this.state.message == "Default Content") {
|
||||
if (this.state.message === "Default Content") {
|
||||
this.setState({ message: "Updated Content!"});
|
||||
}
|
||||
else {
|
||||
|
@ -18,6 +22,7 @@ class App extends Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
console.log(this.asyncCall());
|
||||
return (
|
||||
<div>
|
||||
<div className="h1 bg-secondary text-white text-center p-2">
|
||||
|
@ -25,7 +30,7 @@ class App extends Component {
|
|||
</div>
|
||||
<div className="text-center">
|
||||
<button className="btn btn-secondary" onClick={this.updateContent}>
|
||||
Click Me
|
||||
Click me
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue