Last active
December 7, 2021 06:52
-
-
Save joshxyzhimself/c17a0badd87c74daaed8d6ebd36f711f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// rendered at http://localhost:8080/account | |
export const Account = (props) => { | |
const { user } = props; | |
return ( | |
<div> | |
{ user.username } | |
</div> | |
); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { SignIn } from './SignIn.jsx'; | |
import { Account } from './Account.jsx'; | |
export const App = () => { | |
const [user, set_user] = useState(null); | |
return ( | |
<div> | |
<SignIn set_user={set_user} /> | |
<Account user={user} /> | |
</div> | |
); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// rendered at http://localhost:8080/sign-in | |
export const SignIn = (props) => { | |
const { set_user } = props; | |
const sign_in = async () => { | |
// request | |
assert(response.user instanceof Object); | |
const user = response.user; | |
set_user(user); | |
}; | |
return ( | |
<div> | |
</div> | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment