Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React, { Component } from 'react';
- import {Table} from '../../components/common/Table';
- import Coba from './Coba';
- import axios from 'axios';
- class Talent extends Component {
- constructor(props) {
- super(props);
- this.state = {
- talent: []
- }
- }
- componentDidMount(){
- var th = this;
- axios.get('https://next.json-generator.com/api/json/get/NkmVhBGB4', {
- mode: 'no-cors',
- headers: {
- },
- }).then(function(result) {
- th.setState({
- talent: result.data
- })
- console.log(this.state.talent)
- })
- }
- columns = [
- {title: "Nama", data: "name"},
- {title: "Registered", data: "registered"},
- {title: "About", data: "about"}
- ]
- render() {
- return (
- <div>
- <h1> Halaman Awal </h1>
- <Coba kolom={this.columns} data={this.state.talent}/>
- </div>
- );
- }
- }
- export default Talent;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement