-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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
[Image] Added onLoadingStart/onLoadingFinish/onLoadingError props #604
Conversation
…age component, which are intended to provide loading states for network image sources. Updated the Image component example in the UIExplorer app to demonstrate how they can be used to fade in a network image (using the Animation API). Fixes facebook#98.
@@ -88,6 +90,33 @@ var Image = React.createClass({ | |||
* testing scripts. | |||
*/ | |||
testID: PropTypes.string, | |||
/** | |||
* onLoadingStart - Event callback function to invoke when image load begins. |
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.
nit: can you remove onLoadingStart -
from the beginning. We're displaying it twice on the docs and I sent an internal diff to remove the other ones from this file
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.
Done!
This is awesome! Thanks for doing this! @a2, @nicklockwood can you review? |
👍 this would be incredibly useful! |
… the image loading callback functions (instead of merging). Updated the docs to avoid duplicating prop names.
👍 That's awesome! |
Do we want to stay close to the web here and name them |
@@ -282,6 +298,9 @@ var styles = StyleSheet.create({ | |||
width: 38, | |||
height: 38, | |||
}, | |||
hidden: { | |||
opacity: 0 |
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.
nit: missing a trailing comma
Sorry about the review delay, if you rename the event names i'll pull it in :) |
This is awesome. One further suggestion, I think it would be better with documentation updated all at once :) |
Sure not a problem, I can update docs/Image.md along with the other suggestions. Thanks! |
…TML for load state notifications: onLoadStart, onLoad, onError. Added a section in the Image component docs about the feature including code snippets for a simple image fade-in and using a loading indicator as a placeholder while a large image downloads.
…enaming of Animation module to AnimationExperimental.
👍👍 i need it |
@jordanna maybe you miss |
This is now implemented. |
Intended to provide loading states for network image sources. Updated the Image component example in the UIExplorer app to demonstrate how they can be used to fade in a network image (using the Animation API). Fixes #98.