Next.js Discord

Discord Forum

Preload data before I visit a route

Unanswered
sa'd posted this in #help-forum
Open in Discord
I'm trying to populate a route's page.tsx with some data, that I get through my route handler, which requests it from drizzle. I use useEffect to call my route handler, and set the appropriate hook, and run the map function to populate that data. But my issue is that it takes like 2 seconds before I see the data, upon visting the route. I need it to be instant. Any suggestions would be welcomed since I'm new to the new next 14

8 Replies

All of this part of (app)
These are all the routes that you can navigae to, using the sidebar
This is the /inventory
I'm calling the route handler in this page.tsx, inside a useEffect hook