Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export default function IdealImage(props: Props): ReactNode {

return (
<ReactIdealImage
{...propsRest}
height={img.src.height ?? 100}
width={img.src.width ?? 100}
placeholder={{lqip: img.preSrc}}
Expand Down
20 changes: 20 additions & 0 deletions website/_dogfooding/_pages tests/ideal-image.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

import Image from '@theme/IdealImage';

function Component() {
return (
<Image
className="margin--xl"
style={{width: '100px', height: '32px'}}
img={require('./img/oss_logo.png')}
/>
);
}

export default Component;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions website/_dogfooding/_pages tests/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ import Readme from "../README.mdx"
- [History tests](/tests/pages/history-tests)
- [Embeds](/tests/pages/embeds)
- [Style Isolation tests](/tests/pages/style-isolation)
- [IdealImage tests](/tests/pages/ideal-image)
Loading