need help with fetch json files ( from files) in reactjs
I created a jsx for all json files like this
The error im getting is
Unexpected token '<' , "
<!Doctype"... Is not a valid json
My json like this
3 Replies
Error :
It looks like the path to the file is wrong.
In general you should try to use absolute paths, from the root, as a relative path will be relative to the code that is running it which may well not be the same as where the file is defined.
Also, it would be much better if you posted the actual code rather than screen captures.
Ok , So i can't do like import in json
And access with objects
Or can u tell me a solution , i can't solve this
Sorry I done a small mistake , it works now