Source:  Twitter logo

In my TS React app nothing renders (ReactDOM.render is called in a different file)
App.tsx:

import * as React from 'react';
import './App.css';
import name from './db/db';

const App = () => {
  return (
    <main>
      <h2>Chat App</h2>
      <p>hello {name}</p>
    </main>
  );
}

export default App;

db/db.ts:

import Client from '@replit/database';

const db = new Client();

db.set('name', 'world');

let name: string;

db.get('name').then((value) => {
  name = value;
});

export default name;

I don't get any errors but nothing renders

Copyright © 2022 QueryThreads

All content on Query Threads is licensed under the Creative Commons Attribution-ShareAlike 3.0 license (CC BY-SA 3.0).