cloudinary / cloudinary-react

React components that utilize Cloudinary functionality
MIT License
502 stars 219 forks source link

simpler photo_album sample #90

Closed barbalex closed 5 years ago

barbalex commented 5 years ago

I have a hard time understanding this sample.

It assumes readers are accustomed to:

A truly simple example would not expect readers to read up on other libraries to understand the code.

Especially react-redux can be very annoying for people like me who use primarily local state (via hooks) and where necessary react context (via hooks) or mobx instead. The reason is redux's legendary tendency to introduce lots of structure, files and code and thus make understanding new code a lot of work.

For instance if I want to understand what happens when someone clicks the button Add photos with Cloudinary File upload I have to:

Today you should expect just about any up to date react user to understand using context, local state and inline functions (event handlers).

Wouldn't it be much simpler to just use react context combined with local state (where necessary) and inline functions where possible?

I know inline functions can be suboptimal for performance. But they are optimal to demonstrate what happens in an event.

As far as I can see this example is the only documentation there is on how to use the react-integration. That is why it seems important to me that it be clear and as simple as possible.

strausr commented 5 years ago

@barbalex Thank you for the feedback. The photo album comes to demonstrate a real-life application and therefore includes your described complexities. You can take a look at our documentation for more information on our SDK-https://cloudinary.com/documentation/react_integration

Moreover, if you have any specific questions I'd be happy to assist you.

barbalex commented 5 years ago

@strausr Thanks for your input.

Due to the upload widget not being Gatsby-compatible (https://github.com/cloudinary/pkg-cloudinary-core/issues/25) I have switched to a different service provider and do not have all details in the front of my mind any more. But I do remember that a few things you need to know to get this working are not documented in the SDK and I could only find them in this example.

A different, probably better way to solve this issue would be to make sure everyting is documented in the SDK.

Closing this as this is no longer an issue for me.