How to use the upload widget in react/nextjs using hooks?
Hello,
I found the following example on how to integrate the upload widget to React:
https://support.cloudinary.com/hc/en-us/articles/360020451819-How-to-integrate-the-Upload-Widget-in-your-React-app-
This is class based approach, and React has moved to functional components using hooks. How can I implement the above code using react hooks?
-
Hi Gabriel,
Please take a look at this example:
https://support.cloudinary.com/hc/en-us/articles/360020451819
Best,
Tamara
0 -
Hi, I've been trying to add this to my app but the codesandbox of the example isn't working, the console shows a package fetch error
Regards
0 -
Hi Alvaro.
I was able to use this CodeSandbox from Tamara's example without any issue. Could you please provide us with a fork showing the issue you're encountering?
Many thanks,
-Danny0 -
Hi, trying to implement upload widget in nextjs, but getting an error in CloudinaryService.js:
TypeError: Cannot read properties of undefined (reading 'createUploadWidget')
0 -
Hi Alvarado,
Please share a codesandbox or same environment so that we can investigate further. The error looks like a missing function which is perhaps a missing reference to the library.
Regards,
Anthony
0
Post is closed for comments.
Comments
5 comments