Test Failed
Push — master ( a53bea...3927ec )
by Stefan
02:46
created

Me.render   A

Complexity

Conditions 1

Size

Total Lines 5
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
1
import React, { Component } from 'react';
2
3
class Me extends Component {
4
5
    constructor() {
6
        super();
7
        this.state = { data: "" };
8
    }
9
10
    componentDidMount() {
11
        fetch("https://me-api.listrom.me")
12
            .then(response => response.json())
13
            .then(data => {
14
                this.setState({ data: data.data.msg});
15
                // console.log(this.state.data);
16
            });
17
    };
18
19
    render() {
20
        return (
21
            <main dangerouslySetInnerHTML={{__html: this.state.data}} >
22
            </main>
23
        );
24
    }
25
}
26
27
export default Me;
28