Guest User

Untitled

a guest
Jan 19th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. `Array []
  2. __proto__: {…}
  3. __defineGetter__: function __defineGetter__()
  4. __defineSetter__: function __defineSetter__()
  5. __lookupGetter__: function __lookupGetter__()
  6. __lookupSetter__: function __lookupSetter__()
  7. constructor: function Object()
  8. hasOwnProperty: function hasOwnProperty()
  9. isPrototypeOf: function isPrototypeOf()
  10. propertyIsEnumerable: function propertyIsEnumerable()
  11. toLocaleString: function toLocaleString()
  12. toSource: function toSource()
  13. toString: function toString()
  14. unwatch: function unwatch()
  15. valueOf: function valueOf()
  16. watch: function watch()`
  17.  
  18. function RenderData (jsonData){
  19. console.log(jsonData);
  20. return <p>Dont change me</p>;
  21. }
  22.  
  23. class GetLeaderBoard extends React.Component{
  24. constructor(props) {
  25. super(props);
  26. this.state = {
  27. data:[]
  28. };
  29. }
  30.  
  31. componentDidMount(){
  32. var responseData =[];
  33. axios.get('https://fcctop100.herokuapp.com/api/fccusers/top/recent').then((response)=>{
  34. this.setState(()=>{
  35. return {
  36. data:response.data
  37. }
  38. })
  39.  
  40. })
  41. .catch(function (error) {
  42. console.log(error);
  43. });
  44. }
  45.  
  46. render(){
  47. var renderedData = <RenderData jsonData={this.state.data}/>;
  48. return renderedData
  49. }
  50. }
  51.  
  52. ReactDOM.render(
  53. <GetLeaderBoard />,
  54. document.getElementById('main')
  55. );
Add Comment
Please, Sign In to add comment