-
Notifications
You must be signed in to change notification settings - Fork 24.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to pass height
, width
props to Image
component
#36182
Comments
I was able to reproduce. I vote for the typescript interface of Image props needing an update to match the docs. It also works like this |
Indeed, those props are missing in the .d file. Just did a PR for that |
Nice, thanks @alvessteve. |
…n file (#36196) Summary: According this Issue [`https://github.com/facebook/react-native/issues/36182`](https://github.com/facebook/react-native/issues/36182), the typescript compiler doesn't know the `width`, `height` and `crossOrigin` props for the `Image` component although they are taken in account in the code, [docs](https://reactnative.dev/docs/image#crossorigin) and the flow types. ## Changelog [GENERAL] [FIXED] - Fix missing `height`, `width`, `crossOrigin` props on Typescript Image.d.ts file Pull Request resolved: #36196 Reviewed By: christophpurrer Differential Revision: D43406094 Pulled By: rshest fbshipit-source-id: 547ed142d7c39c361d195275b79b0885ef829ba1
yep still in use. |
thank you @rawatnaresh ! will do a separate PR for that |
…n file (facebook#36196) Summary: According this Issue [`https://github.com/facebook/react-native/issues/36182`](https://github.com/facebook/react-native/issues/36182), the typescript compiler doesn't know the `width`, `height` and `crossOrigin` props for the `Image` component although they are taken in account in the code, [docs](https://reactnative.dev/docs/image#crossorigin) and the flow types. ## Changelog [GENERAL] [FIXED] - Fix missing `height`, `width`, `crossOrigin` props on Typescript Image.d.ts file Pull Request resolved: facebook#36196 Reviewed By: christophpurrer Differential Revision: D43406094 Pulled By: rshest fbshipit-source-id: 547ed142d7c39c361d195275b79b0885ef829ba1
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
This issue was closed because it has been stalled for 7 days with no activity. |
Description
Passing props such as
height
,width
,crossOrigin
to theImage
component throws an error.Version
Output of
npx react-native info
System:
OS: macOS 12.6.2
CPU: (4) x64 Intel(R) Core(TM) i7-5650U CPU @ 2.20GHz
Memory: 72.01 MB / 8.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.16.0 - ~/.nodenv/versions/16.16.0/bin/node
Yarn: 1.22.19 - ~/.nodenv/versions/16.16.0/bin/yarn
npm: 8.11.0 - ~/.nodenv/versions/16.16.0/bin/npm
Watchman: 2022.07.04.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.11.3 - /Users/nareshrawat/.rbenv/shims/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
Android SDK:
Android NDK: 22.1.7171670
IDEs:
Android Studio: 2021.3 AI-213.7172.25.2113.9123335
Xcode: 14.2/14C18 - /usr/bin/xcodebuild
Languages:
Java: 11.0.11 - /Users/nareshrawat/.jenv/shims/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.2.0 => 18.2.0
react-native: 0.71.3 => 0.71.3
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found
Steps to reproduce
Image
componentSnack, code example, screenshot, or link to a repository
RN > 0.71.0
RN < 0.71.0
The text was updated successfully, but these errors were encountered: