React Hooks Tutorial - 14 - Fetching data with useEffect Part 3

preview_player
Показать описание

📱 Follow Codevolution

Fetching data with useEffect
Рекомендации по теме
Комментарии
Автор

Excellent tutorial. I love the fact that each of your tutorial videos conveys one or more key points about a feature with a great example. Comments on your videos often ask for full projects but your approach is the best for learning. There are plenty of other videos that soup up projects that are difficult to follow and the learning is lost in getting the project finished. Your videos are flexible to take a detour at any time to complete a train of thought. Thank you for all your efforts.

shvideo
Автор

This series are the best tutorials of react hooks I've found so far. Thank you very much!

carloscesarvalle
Автор

Done thanks
Setting a state variable in the onclick handler of a button and adding that variable as a dependency for useEffect where you make the fetch request and update state

mostinho
Автор

So glad for your useEffect hook tutorial because I have really struggled with the concepts of it, I still don't understand it 100 percent but I do understand it a lot better after your videos

SahraClayton
Автор

I'm gonna crush this job interview I have tomorrow. You're the best!

alex_blue
Автор

Thanks sir for giving such great content for free of cost. 🙏🙏

saketsingh
Автор

Amazing points in each video.. Thank you very much Vishwas!! May God bless you with lots of good health and energy, you have created such amazing tutorials and helping beginners to grasp the content easily!!

manushreemallaraju
Автор

Terrific explanation. Clear and easy to understand 👏🏻. Hats off to you sir🎩

farsikogama
Автор

Thanks for the great tutorials.
it would be good for your channel and the people following the videos if you added a link to the playlist.

afabio
Автор

Wow... Yours tutorials are very easy to understand and grab the basics of useState and useEffect. Even it will be take a time to understand the concepts if we see a couple of times surely can able to understand the concept... Thanks a lot for your way of teaching skill.

gouthamanvlog
Автор

This is very very helpful for me I totally confused in useEfect how to use but now I got understood easily thankyou sir ❤️❤️

Prabhu_ki_krapa
Автор

Brother you earned my respect.
Amazing explanation and the way you Teach is so calm and mesmerizing.
Much Love from PAKISTAN!!!

mudassir
Автор

never find such a best tutor than you....Thank you very much

ashishnayak
Автор

another way:

const handleClick = e => {
const input =
setIdFromButton(input)
}

return
<input type='text' />
<button type='button' onClick={handleClick}>
Fetch Post
</button>

allone
Автор

good example but probably want to fetch new posts in the onClick handler of the button rather than useEffect right?

dimitrivasilev
Автор

I skipped creating the handleClick function and directly add the id to the useState.

will this have any issue at all?

const [posts, setPosts] = useState([])
const [id, setID] = useState(1)
const [btn, setBtn] = useState(id)

kanonochina
Автор

I have a doubt
I did everything same except I did not made seperate clickHandler instead I wrote the handle logic in button only, like this
<button
But it was throwing error that: "Too many re-renders. React limits the number of renders to prevent an infinite loop."

But when I changed the logic little bit, the error resolved, like this,
<button onClick={() => setClick(id)}>Click</button>

I did not understood this, by just making it callback function why error resolved.

hetparekh
Автор

If I have the same text entered again the button click doesn't work is it because the text change is not detected in this case since the docId remains the same.?

CRUZERDTSI
Автор

How to invoke only on button click and not onload (initializing to 1) ?

vigneshprasad
Автор

This one not working with IOS devices..Any alternative for this available? Please help

maraimalainayagan