L
L
Leonid Markov2018-05-23 15:57:27
JSON
Leonid Markov, 2018-05-23 15:57:27

How to display content of .json file in React JS?

There is a task - to display the contents of the clients.json file - in single blocks or in its entirety. I tried to do this by using asynchronous output via fetch, but for some reason nothing works and I get an error. Maybe there are other options how to parse this file? And then I rummaged through a bunch of sources, but nowhere did I find a clear solution to this problem.
Here is the code https://stackblitz.com/edit/react-clients-list
Please do not throw too many slippers - I'm just starting to learn React JS and there is no one to consult with on some nuances. Any constructive criticism is welcome and any help would be greatly appreciated.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Aleksandr, 2018-05-23
@Sashjkeee

Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.

The error says that there is no return in render or that it does not return anything.
Show your code

R
Roman Sultanov, 2018-05-23
@Sezyara

Why is your function placed in Client1.js, but it does not return anything and generally looks like the wrong component?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question