Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,161,164 members, 7,845,831 topics. Date: Friday, 31 May 2024 at 05:41 AM

Guys, I Need Help With This Reactjs Issue Please. - Programming (2) - Nairaland

Nairaland Forum / Science/Technology / Programming / Guys, I Need Help With This Reactjs Issue Please. (2180 Views)

Reactjs Challenge - Fun Edition / Please I Need Help With This Reactjs Issue - Context Api & RTK (pictures) / Wordpress And Bbpress Issue, Please Help (2) (3) (4)

(1) (2) (3) (Reply) (Go Down)

Re: Guys, I Need Help With This Reactjs Issue Please. by Devdevdev(f): 3:47pm On Nov 15, 2022
chukwuebuka65:


Ok but the lady in question is not ready to learn. She didn’t even try what I suggested to her. She just rush to come and insult me. The journey of programming is a long one. I wonder how she will get far with this attitude.

Can you code what you suggested using the API link in the screenshot?

If you use what you suggested and it works then I owe you 5k.
Re: Guys, I Need Help With This Reactjs Issue Please. by Nobody: 4:29pm On Nov 15, 2022
Devdevdev:


Can you code what you suggested using the API link in the screenshot?

If you use what you suggested and it works then I owe you 5k.

. grin
Re: Guys, I Need Help With This Reactjs Issue Please. by Nobody: 4:35pm On Nov 15, 2022
Devdevdev:


What you are suggesting only works if it's a simple object such as this:
{"Firstname": Brenda, "Lastname": Colby}
With this I wouldn't have needed to map anything. I would have just typed
<h2>{users.firstname}</h2>

It won't work for the kind of object I was retrieving data from, that had nested arrays and objects.

grin grin grin U really don't know how dumb u sound grin

1 Like

Re: Guys, I Need Help With This Reactjs Issue Please. by Devdevdev(f): 4:38pm On Nov 15, 2022
GREATIGBOMAN:


He's right and u are wrong Mrs dumbSkull.

imagine calling ur fellow dummies to tell him he's wrong

grin

Okay, I was wrong. I apologise to ChukwuEbuka65 and to you. I've learned something today. Thanks for the screenshot
Re: Guys, I Need Help With This Reactjs Issue Please. by Nobody: 4:39pm On Nov 15, 2022
Devdevdev:


Okay, I was wrong. I apologise to ChukwuEbuka65 and to you. I've learned something today. Thanks for the screenshot

Sharap and send him his 5k grin
Re: Guys, I Need Help With This Reactjs Issue Please. by tensazangetsu20(m): 4:49pm On Nov 15, 2022
Devdevdev:


Tensazangetsu20, neil63 can you tell this dude that what he is says is wrong? If I tell him myself he won't agree.

Actually he's right. I thought you had no arrays and your inner result was just objects. If it's an array you can call it and Map it.
Re: Guys, I Need Help With This Reactjs Issue Please. by Nobody: 4:49pm On Nov 15, 2022
Devdevdev:


I just rewrote the code using just fetch. Anything I can improve on my code?

I'll appreciate your response. Screenshot is below.

She-Male was even using Math.random() to generate keys with .map()
That could easily give u keys that aren't unique and unnecessary time wasted in computing random numbers when u could simply use the current index of that array.
grin

1 Like

Re: Guys, I Need Help With This Reactjs Issue Please. by chukwuebuka65(m): 5:04pm On Nov 15, 2022
GREATIGBOMAN:


He's right and u are wrong Mrs dumbSkull.

imagine calling ur fellow dummies to tell him he's wrong

grin

You don save me today. Lol

1 Like

Re: Guys, I Need Help With This Reactjs Issue Please. by qtguru(m): 5:52pm On Nov 15, 2022
chukwuebuka65:


You don save me today. Lol

people harsh for this section shocked,

2 Likes

Re: Guys, I Need Help With This Reactjs Issue Please. by niel63(m): 6:05pm On Nov 15, 2022
qtguru:


people harsh for this section shocked,

I swear. Me sef dey thread with plenty carefulness these days. Omo, blood dey hot wella.
Re: Guys, I Need Help With This Reactjs Issue Please. by niel63(m): 6:12pm On Nov 15, 2022
GREATIGBOMAN:


He's right and u are wrong Mrs dumbSkull.

imagine calling ur fellow dummies to tell him he's wrong

grin

The beauty of "await" just like I mentioned up there...

I so much hate that "then" stuff. E too dey stressful aswear.

1 Like

Re: Guys, I Need Help With This Reactjs Issue Please. by Devdevdev(f): 6:23pm On Nov 15, 2022
qtguru:


people harsh for this section shocked,

niel63:


I swear. Me sef dey thread with plenty carefulness these days. Omo, blood dey hot wella.

I'll rather get insulted in the course of getting knowledge then remain quiet and stay ignorant.

I actually don't care if I'm insulted. I'll keep asking questions.

1 Like

Re: Guys, I Need Help With This Reactjs Issue Please. by Devdevdev(f): 6:24pm On Nov 15, 2022
GREATIGBOMAN:


He's right and u are wrong Mrs dumbSkull.

imagine calling ur fellow dummies to tell him he's wrong

grin

This returned a warning error though. There should have been a return before the div that contains the key.
Re: Guys, I Need Help With This Reactjs Issue Please. by qtguru(m): 6:44pm On Nov 15, 2022
Devdevdev:


This returned a warning error though. There should have been a return before the div that contains the key.

You don't need a return because of the fat arrow unless you're returning an object. Paste the error just incase, but his code is right

1 Like

Re: Guys, I Need Help With This Reactjs Issue Please. by Nobody: 7:00pm On Nov 15, 2022
Devdevdev:


This returned a warning error though. There should have been a return before the div that contains the key.




That's implicit return numbhead.

And no errors grin
Re: Guys, I Need Help With This Reactjs Issue Please. by Hannania(m): 7:45pm On Nov 15, 2022
Devdevdev:


I just rewrote the code using just fetch. Anything I can improve on my code?

I'll appreciate your response. The screenshot is below.
For just this API render, this will do. When you learn Redux(using the reduxToolkit library ), try and make use of Axios. It's way neater.
Also, try and use Eslint and style linters In your development environment. It will keep you In check for best practices.

Management with Redux will make your CV stand out amongst applicants.

5 Likes 2 Shares

Re: Guys, I Need Help With This Reactjs Issue Please. by chukwuebuka65(m): 8:32pm On Nov 15, 2022
GREATIGBOMAN:


He's right and u are wrong Mrs dumbSkull.

imagine calling ur fellow dummies to tell him he's wrong

grin

Is that tailwindcss? Or you made your own utility classes? Looks like tailwind is getting popular.
Re: Guys, I Need Help With This Reactjs Issue Please. by Devdevdev(f): 9:11pm On Nov 15, 2022
Hannania:
For just this API render, this will do. When you learn Redux(using the reduxToolkit library ), try and make use of Axios. It's way neater.
Also, try and use Eslint and style linters In your development environment. It will keep you In check for best practices.

Management with Redux will make your CV stand out amongst applicants.

Thanks. I already planned to start learning Redux this week..

1 Like

Re: Guys, I Need Help With This Reactjs Issue Please. by qtguru(m): 10:10pm On Nov 15, 2022
Devdevdev:


Thanks. I already planned to start learning Redux this week..

You're jumping too fast, you don't even know the basics of JS before jumping into Redux. JavaScript is not just syntax, but a lot of other API like DOM, and stuff.

Use a good book.

Not all Front-end jobs are about consuming API, you will be told to create UI Custom Components or debug some frameworks, these are things not taught on freecodecamp and the like.

There's a lot to know, Browser Paint Cycle, Prototype Inheritance,etc

Use a book o, I've worked with various companies and the only saving grace for me has been the Core JS foundation, every framework magic still resolves around JS, even React.

JSX is not supposed to be possible, but something parses it and constructs it into DOM via JavaScript.

JavaScript is massive, other than the syntax, there are a ton of APIs like WebGL, Audio, Video, Canvas, WebWorkers, Storage, Network, and HID the list is long and gets longer.

I work with Svelte for a Gas company in the US, and the code here is insane, we've built a lot of custom UI components draggable widgets, Canvas that renders Shape from an exported C++ Desktop app for Gas Diagrams.

Don't learn Redux, focus on JS first.

I usually don't tell people to read JS first because I know people want quick cash, but if you want to be a seasoned dev, learn JS well. There are 24 Chapters in this book.

Nothing stops you from reading a chapter a day or for 2 days.

I am writing a Shopify Theme and it's pure JavaScript with customElements, that is another API sef I didn't mention, you see how crazy JS is, it keeps expanding.

7 Likes 2 Shares

Re: Guys, I Need Help With This Reactjs Issue Please. by Nobody: 11:12pm On Nov 15, 2022
chukwuebuka65:


Is that tailwindcss? Or you made your own utility classes? Looks like tailwind is getting popular.

Tailwind I used.


Tailwind is popular as at now.... not getting popular.
Re: Guys, I Need Help With This Reactjs Issue Please. by Devdevdev(f): 6:25am On Nov 16, 2022
qtguru:


You're jumping too fast, you don't even know the basics of JS before jumping into Redux. JavaScript is not just syntax, but a lot of other API like DOM, and stuff.

Use a good book.

Not all Front-end jobs are about consuming API, you will be told to create UI Custom Components or debug some frameworks, these are things not taught on freecodecamp and the like.

There's a lot to know, Browser Paint Cycle, Prototype Inheritance,etc

Use a book o, I've worked with various companies and the only saving grace for me has been the Core JS foundation, every framework magic still resolves around JS, even React.

JSX is not supposed to be possible, but something parses it and constructs it into DOM via JavaScript.

JavaScript is massive, other than the syntax, there are a ton of APIs like WebGL, Audio, Video, Canvas, WebWorkers, Storage, Network, and HID the list is long and gets longer.

I work with Svelte for a Gas company in the US, and the code here is insane, we've built a lot of custom UI components draggable widgets, Canvas that renders Shape from an exported C++ Desktop app for Gas Diagrams.

Don't learn Redux, focus on JS first.

I usually don't tell people to read JS first because I know people want quick cash, but if you want to be a seasoned dev, learn JS well. There are 24 Chapters in this book.

Nothing stops you from reading a chapter a day or for 2 days.

I am writing a Shopify Theme and it's pure JavaScript with customElements, that is another API sef I didn't mention, you see how crazy JS is, it keeps expanding.


Thank you, I will read the book.
Re: Guys, I Need Help With This Reactjs Issue Please. by Tobedated(m): 9:14am On Nov 16, 2022
Devdevdev:

Can you code what you suggested using the API link in the screenshot?
If you use what you suggested and it works then I owe you 5k.
sooo
where's the 5k
Re: Guys, I Need Help With This Reactjs Issue Please. by chukwuebuka65(m): 12:09pm On Nov 16, 2022
Tobedated:


sooo

where's the 5k

Be like you want collect.
Re: Guys, I Need Help With This Reactjs Issue Please. by Deicide: 1:16pm On Nov 16, 2022
Please remove that useEffect() it's not needed. Since you wanna render on Button click.
Re: Guys, I Need Help With This Reactjs Issue Please. by Nobody: 2:33pm On Nov 16, 2022
Deicide:
Please remove that useEffect() it's not needed. Since you wanna render on Button click.

I believe it's needed since the page needs to fetch the data on first load.


Also where I think there's a mistake in the person's code is, she didn't add the changePage usestate hook as a dependency in the useEffect hook.


I don't think that her code will change page since that useEffect will run only once.... that is... that fetch won't run more than once.


The changePage hook should be a dependency in useEffect array.
Re: Guys, I Need Help With This Reactjs Issue Please. by Newusername(m): 6:25pm On Nov 16, 2022
qtguru:


You're jumping too fast, you don't even know the basics of JS before jumping into Redux. JavaScript is not just syntax, but a lot of other API like DOM, and stuff.

Use a good book.

Not all Front-end jobs are about consuming API, you will be told to create UI Custom Components or debug some frameworks, these are things not taught on freecodecamp and the like.

There's a lot to know, Browser Paint Cycle, Prototype Inheritance,etc

Use a book o, I've worked with various companies and the only saving grace for me has been the Core JS foundation, every framework magic still resolves around JS, even React.

JSX is not supposed to be possible, but something parses it and constructs it into DOM via JavaScript.

JavaScript is massive, other than the syntax, there are a ton of APIs like WebGL, Audio, Video, Canvas, WebWorkers, Storage, Network, and HID the list is long and gets longer.

I work with Svelte for a Gas company in the US, and the code here is insane, we've built a lot of custom UI components draggable widgets, Canvas that renders Shape from an exported C++ Desktop app for Gas Diagrams.

Don't learn Redux, focus on JS first.

I usually don't tell people to read JS first because I know people want quick cash, but if you want to be a seasoned dev, learn JS well. There are 24 Chapters in this book.

Nothing stops you from reading a chapter a day or for 2 days.

I am writing a Shopify Theme and it's pure JavaScript with customElements, that is another API sef I didn't mention, you see how crazy JS is, it keeps expanding.









I have seen the book. Thank you. You are a great inspiration.
Re: Guys, I Need Help With This Reactjs Issue Please. by Devdevdev(f): 8:58pm On Nov 16, 2022
qtguru, I just started reading the book. I'll spend the night reading it amd I'll continue tomorrow. Thanks for the recommendation.

Re: Guys, I Need Help With This Reactjs Issue Please. by pixey(m): 8:42am On Nov 17, 2022
Devdevdev:
Hi guys. I've been trying to render information from an API but I keep getting errors. My goal is to render the information along with a button that changes the page once clicked.

The information is an object that has an array of objects within it.

Below is the screenshot of the code along with sreenshot of the data I want to fetch. I want to be able to render all the information from the data within the h2 tags.

With arrays, it's straightforward cos all I have to do is map the data from the users but with objects it is more complicated.

Please I'll really appreciate if anyone can provide some help
You really did well but just some refactoring to point out. You didn't have to use async when there is no await and secondly maybe you can set the state to "res.data.results" .This is will give you an array of results you need. I would also recommend you download JSON viewer pro extension and lastly the useEffect hook is not necessary.
Re: Guys, I Need Help With This Reactjs Issue Please. by jikins(m): 8:48am On Nov 17, 2022
GREATIGBOMAN:


I believe it's needed since the page needs to fetch the data on first load.


Also where I think there's a mistake in the person's code is, she didn't add the changePage usestate hook as a dependency in the useEffect hook.


I don't think that her code will change page since that useEffect will run only once.... that is... that fetch won't run more than once.


The changePage hook should be a dependency in useEffect array.

This works better but so does her code even though I feel there are issues with it as she is passing an argument to a function that doesn't accept one. But she is calling the function again every time the user changes page so it will work too I feel.
Re: Guys, I Need Help With This Reactjs Issue Please. by Gbsks: 4:32pm On Nov 19, 2022
qtguru:


You're jumping too fast, you don't even know the basics of JS before jumping into Redux. JavaScript is not just syntax, but a lot of other API like DOM, and stuff.

Use a good book.

Not all Front-end jobs are about consuming API, you will be told to create UI Custom Components or debug some frameworks, these are things not taught on freecodecamp and the like.

There's a lot to know, Browser Paint Cycle, Prototype Inheritance,etc

Use a book o, I've worked with various companies and the only saving grace for me has been the Core JS foundation, every framework magic still resolves around JS, even React.

JSX is not supposed to be possible, but something parses it and constructs it into DOM via JavaScript.

JavaScript is massive, other than the syntax, there are a ton of APIs like WebGL, Audio, Video, Canvas, WebWorkers, Storage, Network, and HID the list is long and gets longer.

I work with Svelte for a Gas company in the US, and the code here is insane, we've built a lot of custom UI components draggable widgets, Canvas that renders Shape from an exported C++ Desktop app for Gas Diagrams.

Don't learn Redux, focus on JS first.

I usually don't tell people to read JS first because I know people want quick cash, but if you want to be a seasoned dev, learn JS well. There are 24 Chapters in this book.

Nothing stops you from reading a chapter a day or for 2 days.

I am writing a Shopify Theme and it's pure JavaScript with customElements, that is another API sef I didn't mention, you see how crazy JS is, it keeps expanding.








Please, What edition is this ? Where can I get the PDF ?

(1) (2) (3) (Reply)

Flutterwave Dollar To Naira Exchange Rate / Programmers help me With This Problem Pls !!!!!!!!!!! / White Screen Error Solved & Getting Whoops! Back In Laravel 5

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 59
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.