Skip to content

Commit 50e8f95

Browse files
tempozslorber
andauthored
fix(ideal-image): <IdealImage> should forward remaining props to the underlying component (#11659)
Co-authored-by: Sébastien Lorber <[email protected]> Co-authored-by: sebastien <[email protected]>
1 parent 9b02423 commit 50e8f95

File tree

4 files changed

+22
-0
lines changed

4 files changed

+22
-0
lines changed

packages/docusaurus-plugin-ideal-image/src/theme/IdealImage/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ export default function IdealImage(props: Props): ReactNode {
9393

9494
return (
9595
<ReactIdealImage
96+
{...propsRest}
9697
height={img.src.height ?? 100}
9798
width={img.src.width ?? 100}
9899
placeholder={{lqip: img.preSrc}}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* Copyright (c) Facebook, Inc. and its affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
import Image from '@theme/IdealImage';
9+
10+
function Component() {
11+
return (
12+
<Image
13+
className="margin--xl"
14+
style={{width: '100px', height: '32px'}}
15+
img={require('./img/oss_logo.png')}
16+
/>
17+
);
18+
}
19+
20+
export default Component;
4.62 KB
Loading

website/_dogfooding/_pages tests/index.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,4 @@ import Readme from "../README.mdx"
4242
- [History tests](/tests/pages/history-tests)
4343
- [Embeds](/tests/pages/embeds)
4444
- [Style Isolation tests](/tests/pages/style-isolation)
45+
- [IdealImage tests](/tests/pages/ideal-image)

0 commit comments

Comments
 (0)