K
If you use Flux architecture, you can store username in store and gain access to it via state. Example with redux: when logged in ,you dispatch an Action: store.dispatch({ type: 'LOGGED IN' }) in example.js to get user name: store.getState().username
CommentThreadFeb 11, 20161Can anyone please suggest me how to get the username of currently logged in user in React component?