Skip to content

Instantly share code, notes, and snippets.

@LiamDotPro
Created February 9, 2017 20:46
Show Gist options
  • Save LiamDotPro/2f3545c411d7de3aeb5388d4f70f85d8 to your computer and use it in GitHub Desktop.
Save LiamDotPro/2f3545c411d7de3aeb5388d4f70f85d8 to your computer and use it in GitHub Desktop.
export default class UserPane extends React.Component {
constructor(props) {
super(props);
this.state = {
ip:"pending",
loc: "pending"
};
}
updateCall() {
console.log(this.updateID);
}
componentDidMount() {
this.response = () => this.getIP();
this.setState({
ip: this.response.ip,
loc: this.response.loc
});
}
async getIP() {
const result = await fetch("http://ipinfo.io","jsonp");
return await {ip: result.ip, loc:result.id};
}
render() {
const loc = "Pending";
const ip = "Pending";
return (
<div className="col-xs-12 col-md-3 home-pane-user nopad">
<UserTile userName="Annonymous" loc={loc} ip={ip} />
<UserReadingList />
<UserQuestion />
</div>
);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment