This commit is contained in:
Mr Brickly
2019-11-06 19:03:17 +00:00
parent 40452b71bf
commit 39969cde6d
13 changed files with 100 additions and 63 deletions

View File

@@ -3,7 +3,7 @@ import React from 'react';
import Fetch from 'unfetch';
export default class Background extends React.Component {
async getAndSetBackground() {
async setBackground() {
try { // First we try and get an image from the API...
let data = await Fetch('https://api.muetab.xyz/getImage?category=Outdoors');
data = await data.json();
@@ -19,7 +19,7 @@ export default class Background extends React.Component {
}
componentDidMount() {
this.getAndSetBackground();
this.setBackground();
}
render() {