| Total Complexity | 2 |
| Complexity/F | 1 |
| Lines of Code | 28 |
| Function Count | 2 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 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 |