Skip to content

Instantly share code, notes, and snippets.

@ayoisaiah
Created January 6, 2020 21:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ayoisaiah/d0fa764908c03da7e2c15cb782b057cf to your computer and use it in GitHub Desktop.
Save ayoisaiah/d0fa764908c03da7e2c15cb782b057cf to your computer and use it in GitHub Desktop.
import React, { useEffect } from 'react';
import './App.css';
import { useAuth0 } from './auth0';
import ChatView from './Chat';
function App() {
useEffect(() => {}, []);
const { loading, user, loginWithRedirect } = useAuth0();
if (loading) {
return <div>Loading...</div>;
}
return (
<div className="App">
{!user && loginWithRedirect({})}
{user && <ChatView />}
</div>
);
}
export default App;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment