I have a locally stored json in my project, which is an array containing around 200+ items.
Example: data.js
const data = [
{
title: 1
},
{
title: 2
},
...
{
title: 200
}
];
My Component:
import {data} from "../mocks/data.js";
I am thinking of a way to use the json data for sometime until I have a database setup, but importing 200+ records slows up the page.
Is there a way I can lazy load the locally json data?
.js
file, maybe you can do it by using hooks:const data = use(import('./data.json'))
.