ant-design/components/image/demo/preview-imgInfo.tsx
希亚的西红柿 c54b9cd892
feat: get image info in the render function of Image component. (#48729)
* feat: add imgInfo for render function

* fix: remove useless code

* fix: revert demo

* chore: bump rc-image verison from 7.6.0 to 7.7.0

* test: update snapshot

* fix: update snapshot

* docs: update version

* docs: update
2024-05-04 18:04:15 +08:00

20 lines
455 B
TypeScript

import React from 'react';
import { Image } from 'antd';
const src = 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png';
const App: React.FC = () => (
<Image
src={src}
width="200px"
height="200px"
alt="test"
preview={{
imageRender: (_, { image }) => <div>{JSON.stringify(image)}</div>,
toolbarRender: (_, { image }) => <div>{JSON.stringify(image)}</div>,
}}
/>
);
export default App;