Skip to content

Instantly share code, notes, and snippets.

@kmikulski kmikulski/post.jsx
Created Jun 7, 2018

Embed
What would you like to do?
the description for this gist
import React, { Component } from 'react';
class UserInfo extends Component {
constructor(props) {
super(props);
this.state = {
name: "",
email: "",
id: ""
};
this.props.keycloak.loadUserInfo().then(userInfo => {
this.setState({name: userInfo.name, email: userInfo.email, id: userInfo.sub})
});
}
render() {
return (
<div className="UserInfo">
<p>Name: {this.state.name}</p>
<p>Email: {this.state.email}</p>
<p>ID: {this.state.id}</p>
</div>
);
}
}
export default UserInfo;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.