DEV Community

OlaNeat Ayoola
OlaNeat Ayoola

Posted on

how to display api response separately in react

hey guys
so i'm working on a blog project where i'm getting multiple api response, but i wan to separate the response. displaying the 1st item only in a different part of my website and displaying the others in another section of website, but i got no idea how to go about this, can anyone please help me out
thanks

Top comments (4)

Collapse
 
wjplatformer profile image
Wj

A possible solution is to create a <div> element for a part of the website you are using. Then you can use inner.html to put the data in there. To retrieve a specific info from JSON {key:"value"} You can use the .key function in JS to retrieve specific data in a list of keys and values. Unfortunately, I don't seem to know quite a lot of JS. Sorry, that I couldn't really help :( .

Collapse
 
olaneat profile image
OlaNeat Ayoola

tnks i will check it out

Collapse
 
wjplatformer profile image
Wj

A few guiding questions:

  1. What API are you using?
  2. Would you send screenshots of the placed you want to put the info?

The maybe solution...

Almost all websites are made using JSON so since you tagged react, you are probably using JS. In that case, you can search up JSON and learn how you can use it!

Collapse
 
olaneat profile image
OlaNeat Ayoola

i'm using express api
then i want to design something like this
dribbble.com/shots/15387747-Press/...