S
S
Sergey Zolotarev2021-09-16 11:45:46
typescript
Sergey Zolotarev, 2021-09-16 11:45:46

How to get rid of "Invariant Violation tried to get frame out of range index NaN"?

Good day!
I still can’t figure out the reason for this message from the compiler:

Invariant Violation tried to get frame out of range index NaN


I implemented fetching and getting data from a CSV file that is inside the application, and when I launched the tsx component, the compiler received an error message.

What does this mean and what did I miss at the base of this question? The examples of the problematic code themselves are in the comments and thank you in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexandroppolus, 2021-09-16
@seregazolotaryow64

FlatList data must be an array or a simple object, and you pass Map there. Perhaps this is the reason.
And by the way, let catList = new StoreListService('categories',null).eventStart(); will create an empty collection. It will be filled in the readRemoteFile callback, that is, asynchronously. If Stores is already drawn by the time it is filled, it will not be updated. This is so, a lyrical digression.
And of course, in the current implementation there will be only 2 entries in catList - id and cat of the last line.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question