-
Notifications
You must be signed in to change notification settings - Fork 557
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UseEffect Hook Not Working #20
Comments
Let me see your “ destroy” line |
@Raghav0407 I am getting the same error can you please help to resolve it |
@Raghav0407 @sharmakhil
That's how I did and it worked. |
how to change the code like you sayed above |
@bharathrames Ya Sure I can help, Changed Code: const sampleFunction = async()=>{
} }, []);` Now I think it will work . |
its working ,
Thank you for your help and immediate response.
Once again thank you very
…On Wed, Jun 28, 2023 at 4:09 PM Raghav0407 ***@***.***> wrote:
Ya Sure I can help,
Changed Code:
useEffect( () => {
const sampleFunction = async()=>{
const data = [];
for (let i = 0; i < 4; i++) {
const image = await axios.get(
${api}/${Math.round(Math.random() * 1000)}
);
const buffer = new Buffer(image.data);
data.push(buffer.toString("base64"));
}
setAvatars(data);
setIsLoading(false);
}
sampleFunction();
}, []);
Now I think it will work .
Please check !
—
Reply to this email directly, view it on GitHub
<#20 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A5ZOIRI2L7SNAULAYXNTHYLXNQCUXANCNFSM6AAAAAAV42MG4E>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Sir I have done till Avatar and till that only useEffect hook is not working and it is showing that destroy function is not defined.
Can you please tell me the error of the hook.
The text was updated successfully, but these errors were encountered: