I have a nextjs page that has some static html and one table that fetchs data from a database. Right now when I navigate to this page it only shows up after the database return its data.
I want to show the data immediately upon the user navigate to the page and then I can wait to fill the table with data.
export const getServerSideProps = async (context) => {
console.log('Fetching AWS data');
// Fetch the data...
return { props: { rowData: response } }
}
export default function Digest({ rowData }) {
return <>
// I want to render this h1 tag below
// before the getServerSideProps returns its values
<h1>Newsletter</h1>
<NewsletterTable rowData={rowData} />
</>
}