Skip to content

Commit 6857be2

Browse files
author
Nir Maoz
authored
docs: update README example (#168)
1 parent 66f9fd8 commit 6857be2

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

README.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -40,28 +40,28 @@ npm i @cloudinary/react @cloudinary/url-gen
4040
The following is a simple example using [React](https://cloudinary.com/documentation/react2_integration).
4141
For more information on React and other frameworks, navigate to the specific reference using the **Packages** menu.
4242
```javascript
43-
// Import the Cloudinary class, and the plugins you want to use.
44-
// In this case, we import a Cloudinary image type, accessibility and responsive.
45-
46-
import React, { Component } from 'react'
43+
import React from 'react'
44+
// Cloudinary is used to configure your account and generate urls for your media assets
4745
import {Cloudinary} from "@cloudinary/url-gen";
48-
import { AdvancedImage, accessibility, responsive } from '@cloudinary/react';
46+
// Import the cloudinary media component (AdvancedImage / AdvancedVideo),
47+
// and the plugins you want to use.
48+
import {AdvancedImage, accessibility, responsive} from '@cloudinary/react';
4949

5050
// Once per project/app - configure your instance.
51-
// See the documentation in @cloudinary/url-gen for more information.
52-
const myCld = new Cloudinary({ cloudName: 'demo'});
53-
54-
// Render your component.
55-
const App = () => {
56-
// Create your image.
57-
// This creates a new image object:
58-
let img = myCld().image('sample');
59-
return (
60-
<div>
61-
<AdvancedImage cldImg={img} plugins={[responsive(), accessibility()]}/>
62-
</div>
63-
)
64-
};
51+
// See the documentation of @cloudinary/url-gen for more information.
52+
const myCld = new Cloudinary({cloud: {cloudName: 'demo'}});
53+
54+
export const App = () => {
55+
// Create a new image object:
56+
const img = myCld.image('sample');
57+
58+
// Render your component.
59+
return (
60+
<div>
61+
<AdvancedImage cldImg={img} plugins={[responsive(), accessibility()]}/>
62+
</div>
63+
)
64+
};
6565
```
6666

6767
## Plugin Order

0 commit comments

Comments
 (0)