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
Update docs on static image imports #26211
Conversation
Co-authored-by: Lachlan Campbell <lachlanjc@hey.com>
|
||
You can `import` images that live in your project. (Note that `require` is not supported—only `import`.) | ||
|
||
With direct `import`s, `width`, `height`, and `blurDataURL` will be automatically provided to the image component. Alt text is still needed separately. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's call it "static imports" instead of "direct imports" (I don't think we use direct anywhere else)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good flag!
With direct `import`s, `width`, `height`, and `blurDataURL` will be automatically provided to the image component. Alt text is still needed separately. | |
With static `import`s, `width`, `height`, and `blurDataURL` will be automatically provided to the image component. Alt text is still needed separately. |
} | ||
``` | ||
|
||
For dynamic images you have to provide `width`, `height` and `blurDataURL` manually. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be more clear if you define "dynamic image" which really means "src is a string"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For dynamic images you have to provide `width`, `height` and `blurDataURL` manually. | |
For images where you’re passing a URL to `src`, you have to provide `width`, `height` and `blurDataURL` manually. |
Incorporates some of the feedback we've had about this doc. ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. ## Documentation / Examples - [ ] Make sure the linting passes
Incorporates some of the feedback we've had about this doc.
Bug
fixes #number
Feature
fixes #number
Documentation / Examples