Skip to content

Instantly share code, notes, and snippets.

@joshxyzhimself
Last active December 7, 2021 06:52
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 joshxyzhimself/c17a0badd87c74daaed8d6ebd36f711f to your computer and use it in GitHub Desktop.
Save joshxyzhimself/c17a0badd87c74daaed8d6ebd36f711f to your computer and use it in GitHub Desktop.
// rendered at http://localhost:8080/account
export const Account = (props) => {
const { user } = props;
return (
<div>
{ user.username }
</div>
);
};
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>
);
};
// 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