Skip to content

Instantly share code, notes, and snippets.

@alancasagrande
Last active November 16, 2020 13:21
Show Gist options
  • Save alancasagrande/308cd2ceb049d9e238d07c1d98dbbf1d to your computer and use it in GitHub Desktop.
Save alancasagrande/308cd2ceb049d9e238d07c1d98dbbf1d to your computer and use it in GitHub Desktop.
import React, { useState } from 'react';
import ReactDOM from 'react-dom';
import { login } from './api';
import App from './App';
(async () => {
// try to login with cookie
const res = await login();
// init app
const domContainer = document.createElement('div');
document.body.appendChild(domContainer);
ReactDOM.render(<App user={res.user} />, domContainer);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment