Skip to content

Instantly share code, notes, and snippets.

@joshxyzhimself
Last active December 7, 2021 06:52
Embed
What would you like to do?
// 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