Reputation: 1
I want to implement search in a react project where i have a file locally in the project folder and i want to search from that file.
Should i load the file data into a state variable? not sure but i don't think that is something i should implement since the file can be very large in size.
Any help or direction would be appreciated, thanks!
Currently i'm storing the data into a state and then performing the search. I wanted to know if there are any better ways to do the same.
Upvotes: 0
Views: 555
Reputation: 1
You are right about it. loading a file in state first of all can be a bad idea because its loaded like an Array Buffer or sort, so its all binary not exact text. Hence search would be a problem.
This usecase is more for the backend side to handle in Real World scenarios.
Upvotes: 0