0

http://cloudinary.com/blog/how_to_build_an_image_library_with_react_cloudinary

(except I used create-react-app instead of manually configuring webpack)

Where the script is added to of index.html:

<script src="//widget.cloudinary.com/global/all.js" type="text/javascript"></script>

and then the functionality is included in a component:

uploadWidget() {
    cloudinary.openUploadWidget({ cloud_name: 'CLOUD_NAME', upload_preset: 'PRESET', tags:['xmas']},
        function(error, result) {
            console.log(result);
        });
}

However I am getting the error: 'cloudinary' is not defined

Is cloudinary supposed to be available there after simply adding the script? Am I missing a step?

1 Answer 1

3

Try to access it through window.cloudinary. Also make sure that the script is included before your React script is included.

Sign up to request clarification or add additional context in comments.

1 Comment

It was window.cloudinary. Appreciate it!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.